(function(){if(!!BX.adminPanel)return;BX.adminPanel=function(){this.buttons=[];this.panel=null;this.modifyFormElements=BX.adminFormTools.modifyFormElements;this.modifyFormElement=BX.adminFormTools.modifyFormElement;this._showMenu=function(t){if(this.CONFIG.MENU){BX.adminShowMenu(this.BUTTON,this.CONFIG.MENU,{active_class:"adm-header-language-active"})}return BX.PreventDefault(t)};BX.ready(BX.defer(this.Init,this))};BX.adminPanel.isFixed=BX.False;BX.adminPanel.prototype.Init=function(){this.panel=BX("bx-panel");if(!!this.panel){for(var t=0;t<this.buttons.length;t++){this.buttons[t].BUTTON=BX(this.buttons[t].ID);if(this.buttons[t].BUTTON){if(this.buttons[t].CONFIG.MENU){this.setButtonMenu(this.buttons[t])}}}BX.defer(this._recountWrapHeight,this)()}};BX.adminPanel.prototype.registerButton=function(t,e){this.buttons.push({ID:t,CONFIG:e})};BX.adminPanel.prototype.setButtonMenu=function(t){BX.bind(t.BUTTON,"click",BX.delegate(this._showMenu,t))};BX.adminPanel.prototype.isFixed=function(){return BX.type.isDomNode(this.panel)&&BX.hasClass(document.documentElement,"adm-header-fixed")};BX.adminPanel.prototype.Fix=function(t){var e=this.isFixed();if(e){this.panel.parentNode.style.height="auto";BX.removeClass(document.documentElement,"adm-header-fixed");t.title=BX.message("JSADM_PIN_ON")}else{BX.addClass(document.documentElement,"adm-header-fixed");t.title=BX.message("JSADM_PIN_OFF");BX.defer(this._recountWrapHeight,this)()}BX.userOptions.save("admin_panel","settings","fix",e?"off":"on");BX.onCustomEvent("onAdminPanelFix",[!e])};BX.adminPanel.prototype.addDesktop=function(){new BX.CAdminDialog({content_url:"/bitrix/components/bitrix/desktop/admin_settings.php?lang="+BX.message("LANGUAGE_ID")+"&bxpublic=Y",content_post:"sessid="+BX.bitrix_sessid()+"&type=desktop&desktop_page=0&action=new&desktop_backurl=/bitrix/admin/",draggable:true,resizable:true,buttons:[BX.CAdminDialog.btnSave,BX.CAdminDialog.btnCancel]}).Show()};BX.adminPanel.prototype.recalcDesktopSettingsDialog=function(t){if(!t)t=window.event;var e=this.value;if(t.type=="blur"&&e.length<=0){e=current_col_count;BX("SETTINGS_COLUMNS").value=e}else if(t.type=="keyup"&&(parseInt(e)<=0||parseInt(e)>=10)){current_col_count=e=2;BX("SETTINGS_COLUMNS").value=e}else if(t.type=="keyup"&&e.length>0)current_col_count=e;var i=BX.findParent(this,{tag:"tbody"});var s=BX.findChildren(i,{tag:"tr",class:"bx-gd-admin-settings-col"},true);if(!s)s=[];for(var a=0;a<s.length;a++){if(a>=e)s[a].parentNode.removeChild(s[a])}var n=e-a;for(a=0;a<n;a++){i.appendChild(BX.create("tr",{props:{className:"bx-gd-admin-settings-col"},children:[BX.create("td",{attrs:{width:"40%"},html:BX.message("langGDSettingsDialogRowTitle")+(parseInt(s.length)+parseInt(a)+1)}),BX.create("td",{attrs:{width:"60%"},children:[BX.create("input",{attrs:{type:"text",size:"5",maxlength:"6"},props:{id:"SETTINGS_COLUMN_WIDTH_"+(s.length+a),name:"SETTINGS_COLUMN_WIDTH_"+(s.length+a),value:""}})]})]}))}};BX.adminPanel.prototype.setTitle=function(t){document.title=BX.message("TITLE_PREFIX")+t;var e=BX("adm-title");if(e){if(e.firstChild&&e.firstChild.nodeType==3){e.replaceChild(document.createTextNode(t),e.firstChild)}else if(e.firstChild){e.insertBefore(e.firstChild,document.createTextNode(t))}else{BX.adjust(e,{text:t})}}};BX.adminPanel.prototype._recountWrapHeight=function(){if(this.isFixed())BX.adminPanel.panel.parentNode.style.height=BX.adminPanel.panel.offsetHeight+"px";BX.onCustomEvent(this,"onAdminPanelChange")};BX.adminPanel.prototype.Notify=function(t){if(!BX.isReady){var e=arguments;BX.ready(BX.defer((function(){BX.adminPanel.Notify.apply(this,e)})));return}if(null==BX.adminPanel.NOTIFY&&BX.adminPanel.panel){BX.adminPanel.NOTIFY=BX.adminPanel.panel.appendChild(BX.create("DIV",{props:{className:"adm-warning-block"},html:'<span class="adm-warning-text">'+(t||"&nbsp;")+'</span><span class="adm-warning-icon"></span><span onclick="BX.adminPanel.hideNotify(this.parentNode)" class="adm-warning-close"></span>'}))}else{if(BX.adminPanel.NOTIFY){BX.adminPanel.NOTIFY.firstChild.innerHTML=t||"&nbsp;"}}BX.removeClass(BX.adminPanel.NOTIFY,"adm-warning-animate");BX.defer(this._recountWrapHeight,this)();setTimeout(BX.proxy(this._recountWrapHeight,this),310)};BX.adminPanel.hideNotify=BX.adminPanel.prototype.hideNotify=function(t){t=BX.type.isDomNode(t)?t:this;if(!!t&&!!t.parentNode&&!!t.parentNode.parentNode){t.style.height=t.offsetHeight+"px";setTimeout((function(){BX.addClass(t,"adm-warning-animate")}),50)}if(BX.type.isDomNode(t)&&t.getAttribute("data-ajax")=="Y"){var e=parseInt(t.getAttribute("data-id"));if(e>0){BX.ajax({url:"/bitrix/admin/admin_notify.php",method:"POST",dataType:"json",data:{ID:e,sessid:BX.bitrix_sessid()}})}}BX.defer(this._recountWrapHeight,this)();setTimeout(BX.proxy(this._recountWrapHeight,this),310)};BX.adminPanel.Redirect=BX.adminPanel.prototype.Redirect=function(t,e,i){var s=false;if(t&&t.length>0)i=t[0];if(!i)i=window.event;try{if(i)s=i.shiftKey}catch(i){}if(s)window.open(e);else{var a=window.location.search;if(a.indexOf("IFRAME_TYPE=PUBLIC_FRAME")!==-1||a.indexOf("IFRAME_TYPE%3DPUBLIC_FRAME")!==-1){top.window.location.href=e}else{window.location.href=e}}};BX.adminPanel._reShowWait=BX.adminPanel.prototype._reShowWait=function(){BX.adminPanel.closeWait(this);BX.adminPanel.showWait(this)};BX.adminPanel.showWait=BX.adminPanel.prototype.showWait=function(t){if(t&&!BX.type.isElementNode(t))t=null;t=t||this;if(BX.type.isElementNode(t)&&(t.type=="button"||t.type=="submit")&&!!t.name&&BX.util.in_array(t.name.toLowerCase(),["save","apply","cancel","save_and_add","set_filter","del_filter","template_preview"])){if(t.disabled==true)return null;BX.defer((function(){t.disabled=true}))();var e=BX.hasClass(t,"adm-btn-save")||BX.hasClass(t,"adm-btn-save"),i=BX.findParent(t,BX.is_relative),s=BX.pos(t,!!i);t.bxwaiter=(i||document.body).appendChild(BX.create("DIV",{props:{className:"adm-btn-load-img"+(e?"-green":"")},style:{top:parseInt((s.bottom+s.top)/2-9)+"px",left:parseInt((s.right+s.left)/2-9)+"px"}}));BX.addClass(t,"adm-btn-load");BX.adminPanel.lastWaitElement=t;return t.bxwaiter}return null};BX.adminPanel.closeWait=BX.adminPanel.prototype.closeWait=function(t){if(t&&!BX.type.isElementNode(t))t=null;t=t||BX.adminPanel.lastWaitElement||this;if(BX.type.isElementNode(t)){if(t.bxwaiter&&t.bxwaiter.parentNode){t.bxwaiter.parentNode.removeChild(t.bxwaiter);t.bxwaiter=null}t.disabled=false;BX.removeClass(t,"adm-btn-load");if(BX.adminPanel.lastWaitElement==t)BX.adminPanel.lastWaitElement=null}};BX.adminFormTools={modifyFormElements:function(t,e){var i=BX.findFormElements(t);if(i&&i.length>0){for(var s=0;s<i.length;s++){BX.adminFormTools.modifyFormElement(i[s],e)}}},modifyFormElement:function(t,e){if(typeof e=="undefined"||!BX.type.isArray(e))e=["checkbox","file"];if(t&&BX.type.isElementNode(t)&&!!t.type){if(BX.util.in_array("*",e)||BX.util.in_array(t.type,e)){switch(t.type){case"checkbox":return BX.adminFormTools.modifyCheckbox(t);case"file":return BX.adminFormTools.modifyFile(t);case"select-one":case"select-multiple":return BX.adminFormTools.modifySelect(t);case"button":case"submit":case"reset":return BX.adminFormTools.modifyButton(t);default:return t}}else{return t}}return null},modifyCheckbox:function(t){if((!BX.browser.IsIE()||BX.browser.IsIE9())&&BX.type.isElementNode(t)&&t.tagName.toUpperCase()=="INPUT"&&t.type.toUpperCase()=="CHECKBOX"){if(!BX.hasClass(t,"adm-designed-checkbox")&&!BX.hasClass(t,"ui-ctl-element")){if(!t.id)t.id="designed_checkbox_"+Math.random();var e=BX.create("LABEL",{props:{className:"adm-designed-checkbox-label",htmlFor:t.id,title:t.title}});BX.addClass(e,t.className);BX.addClass(t,"adm-designed-checkbox");if(!!t.nextSibling)t.parentNode.insertBefore(e,t.nextSibling);else t.parentNode.appendChild(e)}}},modifyFile:function(t){if(!BX.hasClass(t,"adm-designed-file")&&!t.hasAttribute("data-fileinput")){var e=BX.create("SPAN",{props:{className:"adm-input-file"},html:"<span>"+(!!t.multiple?BX.message("JSADM_FILES"):BX.message("JSADM_FILE"))+"</span>"});BX.bind(t,"change",BX.adminFormTools._modified_file_onchange);BX.addClass(t,"adm-designed-file");if(t.parentNode)t.parentNode.insertBefore(e,t);e.appendChild(t);return e}else{return t}},_modified_file_onchange:function(){var t=this.files||[this.value],e="";if(!t||t.length<=0){e=!!this.multiple?BX.message("JSADM_FILES"):BX.message("JSADM_FILE")}else{e="";for(var i=0;i<t.length;i++){var s=t[i].name||t[i];var a=Math.max(s.lastIndexOf("/"),s.lastIndexOf("\\"));if(a>0)s=s.substring(a+1,s.length);e+=(e==""?"":", ")+s}}this.parentNode.firstChild.innerHTML=e},modifySelect:function(t){if(BX.type.isElementNode(t)&&t.tagName.toUpperCase()=="SELECT"){if(t.type=="select-one"){if(!BX.hasClass(t,"adm-select")){var e=BX.create("SPAN",{props:{className:"adm-select-wrap"}});BX.addClass(t,"adm-select");if(t.parentNode)t.parentNode.insertBefore(e,t);e.appendChild(t);return e}}}return null},modifyButton:function(t){if(BX.type.isElementNode(t)&&t.tagName.toUpperCase()=="INPUT"&&(t.type=="submit"||t.type=="reset"||t.type=="button")&&!BX.hasClass(t,"adm-btn")&&!BX.hasClass(t,"adm-btn-save")&&!BX.hasClass(t,"adm-btn-green")){var e=BX.create("SPAN",{props:{className:"adm-btn-wrap "+t.className}});t.className="adm-btn";if(t.parentNode)t.parentNode.insertBefore(e,t);e.appendChild(t);return e}else{return t}}};BX.adminMenu=function(){this.activeSection="";this.oSections={};this.items=[];this.easing={};var t=this.dest={item:null,fav:null};this.dest_cont={item:null,fav:null};this.bMinimized=false;var e=null;var i=function(t){var e=this.BXTYPEKEY;BX("fav_text_"+e).style.display="none";if(t){BX("fav_text_error_"+e).style.display="none";BX("fav_text_finish_"+e).style.display="inline-block";BX("fav_icon_finish_"+e).style.display="inline-block"}else{BX("fav_text_finish_"+e).style.display="none";BX("fav_icon_finish_"+e).style.display="none";BX("fav_text_error_"+e).style.display="inline-block"}BX.adminFav.refresh(t);this.bxprogress=false;if(!this.bxover){l.apply(this)}};var s=this._ondestdragfinish={item:BX.delegate((function(t){if(typeof t.BXMENUITEM=="undefined"||!this.items[t.BXMENUITEM])return;e="item";this.dest[e].bxprogress=true;var s=this.items[t.BXMENUITEM].CONFIG.TEXT||t.innerText||t.textContent;if(this.items[t.BXMENUITEM].CONFIG.TITLE){var a=BX("adm-title");if(a){var n=a.textContent||a.innerText;if(n)s=n+": "+s}}BX.adminFav.add(s,this.items[t.BXMENUITEM].CONFIG.URL,this.items[t.BXMENUITEM].CONFIG.ID,this.items[t.BXMENUITEM].CONFIG.MODULE_ID,BX.proxy(i,this.dest.item))}),this),fav:BX.delegate((function(t){if(typeof t.BXMENUITEM=="undefined"||!this.items[t.BXMENUITEM]||!this.items[t.BXMENUITEM].CONFIG.FAV_ID)return;e="fav";this.dest[e].bxprogress=true;BX.adminFav.del(this.items[t.BXMENUITEM].CONFIG.FAV_ID,BX.proxy(i,this.dest.fav))}),this)};var a=function(){jsDD.refreshDestArea(this)};var n=BX.delegate((function(t){if(typeof t.BXMENUITEM=="undefined"||!this.items[t.BXMENUITEM])return;var e=!!this.items[t.BXMENUITEM].CONFIG.FAV_ID?"fav":"item";this.dest_cont[e].bxprogress=true;BX.adminFav.showDDBlock(this.dest_cont[e],BX.proxy(a,this.dest[e]));BX.bind(window,"scroll",BX.proxy(a,this.dest[e]))}),this);var o=function(){this.bxover=true};var r=function(){this.bxover=false;setTimeout(BX.delegate((function(){if(!this.bxover&&!this.bxprogress)l.apply(this)}),this),100)};var l=this._ondestdragstop=BX.delegate((function(){if(!e||e==BX.proxy_context.BXTYPEKEY){var t=BX.proxy_context.BXTYPEKEY;if(e==BX.proxy_context.BXTYPEKEY){this.dest_cont.bxover=true;BX.bind(BX.proxy_context,"mouseover",o);BX.bind(BX.proxy_context,"mouseout",r);e=null}else{BX.adminFav.hideDDBlock(this.dest_cont[t],(function(){BX("fav_text_"+t).style.display="inline-block";BX("fav_text_error_"+t).style.display="none";BX("fav_text_finish_"+t).style.display="none";BX("fav_icon_finish_"+t).style.display="none"}));BX.unbind(window,"scroll",BX.proxy(a,this.dest[t]));BX.unbind(BX.proxy_context,"mouseover",o);BX.unbind(BX.proxy_context,"mouseout",r);BX.unbind(this.dest_cont[t],"mouseout",BX.proxy(l,BX.proxy_context))}}}),this);this._onitemdragstart=function(){n(this.NODE);if(null==this.MIRROR){this.MIRROR=document.body.appendChild(BX.create("DIV",{props:{className:BX.hasClass(this.NODE,"adm-main-menu-item")?"adm-favorites-main-menu-wrap":"adm-favorites-sub-menu-wrap"},html:this.NODE.outerHTML||this.NODE.innerHTML}))}this.MIRROR.style.display="block"};this._onitemdrag=function(t,e){var i=BX.GetWindowSize();var s=parseInt(e-this.MIRROR.offsetHeight/2),a=parseInt(t-this.MIRROR.offsetWidth/2);var n=i.scrollLeft+i.innerWidth-20;if(a+this.MIRROR.offsetWidth>n)a-=a+this.MIRROR.offsetWidth-n;if(a<=i.scrollLeft)a=i.scrollLeft;this.MIRROR.style.left=a+"px";this.MIRROR.style.top=s+"px"};this._onitemdragstop=function(){this.MIRROR.style.display="none"};BX.ready(BX.delegate(this.Init,this))};BX.adminMenu.prototype.Init=function(){if(!!BX("bx_menu_panel",true)){for(var t in this.dest){if(!BX("fav_dest_"+t)||!BX("fav_cont_"+t)){continue}this.dest[t]=BX("fav_dest_"+t);this.dest_cont[t]=BX("fav_cont_"+t);this.dest[t].BXTYPEKEY=t;this.dest[t].onbxdestdraghover=function(){BX.addClass(this,"adm-favorites-center-hover")};this.dest[t].onbxdestdraghout=function(){BX.removeClass(this,"adm-favorites-center-hover")};this.dest[t].onbxdestdragfinish=this._ondestdragfinish[t];this.dest[t].onbxdestdragstop=BX.proxy(this._ondestdragstop,this.dest[t]);jsDD.registerDest(this.dest[t])}setTimeout(BX.delegate(this.InitDeferred,this),200)}};BX.adminMenu.prototype.InitDeferred=function(){new BX.adminMenuResizer(BX("bx_menu_panel",true),!!this.bMinimized);for(var t=0;t<this.items.length;t++){this._registerItem(t)}};BX.adminMenu.prototype.showFavorites=function(t){if(!!t)BX.fireEvent(t,"mouseout");this.GlobalMenuClick("desktop");if(BX.adminFav.lastId>0){var e=BX.findChild(BX("_global_menu_desktop"),{attr:{"data-fav-id":BX.adminFav.lastId}},true);if(!!e){BX.defer((function(){var t=BX.pos(e),i=BX.GetWindowSize(),s=i.scrollTop+i.innerHeight;if(t.bottom>s||t.top<i.scrollTop){window.scrollTo(i.scrollLeft,t.top-parseInt(i.innerHeight/2))}BX.addClass(e,"adm-submenu-current-fav");new BX.easing({duration:1200,start:{opacity:0},finish:{opacity:100},transition:function(t){return Math.abs(Math.sin(3*Math.PI*t/2))},step:function(t){e.style.background="rgba(242,245,220,"+t.opacity/100+")"},complete:function(){e.style.background="#f2f5dc";var t=function(){this.style.background=null;BX.removeClass(this,"adm-submenu-current-fav");BX.unbind(this,"mouseover",t)};BX.bind(e,"mouseover",t)}}).animate()}))()}}};BX.adminMenu.prototype.itemsStretchScroll=function(){this.items.forEach((function(t){if(t&&t.MSOVERMIRROR){t.MSOVERMIRROR.style.display="none"}}))};BX.adminMenu.prototype.setMinimizedState=function(t){this.bMinimized=t};BX.adminMenu.prototype.setActiveSection=function(t){this.activeSection=t};BX.adminMenu.prototype.setOpenedSections=function(t){var e=t.split(",");for(var i in e){this.oSections[e[i]]=true}};BX.adminMenu.prototype.GlobalMenuClick=function(t){if(t==this.activeSection){return}if(!!this.activeSection){BX.removeClass(BX("global_menu_"+this.activeSection,true),"adm-main-menu-item-active");BX.removeClass(BX("global_submenu_"+this.activeSection,true),"adm-global-submenu-active adm-global-submenu-animate")}this.activeSection=t;BX.addClass(BX("global_menu_"+this.activeSection,true),"adm-main-menu-item-active");BX.addClass(BX("global_submenu_"+this.activeSection,true),"adm-global-submenu-active");if(BX.browser.isPropertySupported("transition")){BX("global_submenu_"+t,true).style.opacity=0;setTimeout((function(){BX.addClass(BX("global_submenu_"+t,true),"adm-global-submenu-animate")}),0)}BX.onCustomEvent(this,"onMenuChange")};BX.adminMenu.prototype.startAnimation=function(t,e,i){if(!this.easing[e]){this.easing[e]={icon:BX.findChild(t,{className:"adm-submenu-item-arrow-icon"},true),animation:null,opening:i,childrenCont:t.childNodes[1],startHeight:0}}if(this.easing[e].animation)this.easing[e].animation.stop();this.easing[e].opening=i;this.easing[e].startHeight=this.easing[e].childrenCont.offsetHeight;this.easing[e].childrenCont.style.overflowY="hidden";this.easing[e].childrenCont.style.height=this.easing[e].startHeight+"px";BX.addClass(this.easing[e].childrenCont,"adm-sub-submenu-block-children-animate");if(BX.browser.isPropertySupported("transform"))BX.addClass(this.easing[e].icon,"adm-submenu-item-arrow-icon-animate")};BX.adminMenu.prototype.endAnimation=function(t){if(!this.easing[t])return;var e=this.easing[t].opening;var i=this.easing[t].icon;var s=this.easing[t].childrenCont;var a=BX.browser.isPropertySupported("transform");this.easing[t].animation=new BX.easing({duration:200,start:{rotation:0,height:this.easing[t].startHeight,opacity:e?0:100},finish:{rotation:e?90:-90,height:e?this.easing[t].childrenCont.scrollHeight:0,opacity:e?100:0},transition:BX.easing.transitions.linear,step:function(t){if(a!==false){i.style[a]="rotate("+t.rotation+"deg)"+(a=="WebkitTransform"?" translate3d(0, 0, 0)":"")}s.style.height=t.height+"px";s.style.opacity=t.opacity/100},complete:BX.proxy((function(){i.style.cssText="";s.style.cssText="";BX.removeClass(i,"adm-submenu-item-arrow-icon-animate");BX.removeClass(s,"adm-sub-submenu-block-children-animate");this.easing[t].animation=null}),this)});this.easing[t].animation.animate()};BX.adminMenu.prototype.toggleSection=function(t,e,i){var s=!BX.hasClass(t,"adm-sub-submenu-open");this.startAnimation(t,e,s);if(s)BX.addClass(t,"adm-sub-submenu-open");else BX.removeClass(t,"adm-sub-submenu-open");this.endAnimation(e);if(i<=2){this.oSections[e]=s;var a="";for(var n in this.oSections){if(this.oSections[n]==true){a+=(a!=""?",":"")+n}}BX.userOptions.save("admin_menu","pos","sections",a)}BX.onCustomEvent(this,"onMenuChange");return s};BX.adminMenu.prototype.toggleDynSection=function(t,e,i,s,a){if(e.BXLOAD){this.toggleSection(e,s,a);return}e.BXLOAD=true;e.BXLOAD_AJAX=false;var n=BX.create("SPAN",{props:{className:"adm-submenu-loading adm-sub-submenu-block"},style:{marginLeft:parseInt(t)+"px"},text:BX.message("JS_CORE_LOADING")});setTimeout(BX.proxy((function(){if(!e.BXLOAD_AJAX){e.childNodes[1].appendChild(n);this.toggleSection(e,s,a)}}),this),200);BX.ajax.get("/bitrix/admin/get_menu.php",{lang:BX.message("LANGUAGE_ID"),admin_mnu_module_id:i,admin_mnu_menu_id:s},BX.proxy((function(t){e.BXLOAD_AJAX=true;t=BX.util.trim(t);if(t!=""){var i=n.parentNode?true:false;e.childNodes[1].innerHTML=t;if(!i)this.toggleSection(e,s,a)}else{n.innerHTML=BX.message("JS_CORE_NO_DATA");if(!n.parentNode){e.childNodes[1].appendChild(n);this.toggleSection(e,s,a)}}BX.onCustomEvent(this,"onMenuChange")}),this))};BX.adminMenu.prototype._item_onmouseover=function(){this.bxover=true;setTimeout(BX.proxy(BX.adminMenu.__item_onmouseover,this),500)};BX.adminMenu.prototype._item_onmouseout=function(){this.bxover=false;setTimeout(BX.proxy(BX.adminMenu.__item_onmouseout,this),50)};BX.adminMenu.prototype.__item_onmouseover=function(){if(this.bxover){var t=BX.pos(this.NODE.lastChild.lastChild);if(t.right>BX("bx_menu_panel",true).offsetWidth){var e=BX.pos(this.NODE);if(!this.MSOVERMIRROR){var i=BX.hasClass(this.NODE.parentNode,"adm-submenu-item-active");this.MSOVERMIRROR=BX("menu_mirrors_cont").appendChild(BX.create("DIV",{props:{className:"adm-submenu-longname"+(i?" adm-submenu-active-longname":"")},html:this.NODE.outerHTML||this.NODE.innerHTML}))}BX.adjust(this.MSOVERMIRROR,{style:{top:e.top+"px",left:e.left+"px",height:e.height+"px",display:"inline-block"}})}}};BX.adminMenu.prototype.__item_onmouseout=function(){if(!this.bxover&&!!this.MSOVERMIRROR){this.MSOVERMIRROR.style.display="none"}};BX.adminMenu.prototype._registerItem=function(t){this.items[t].NODE=BX(this.items[t].ID)?BX(this.items[t].ID):top.BX(this.items[t].ID);this.items[t].NODE.BXMENUITEM=t;if(this.items[t].NODE){this.items[t].NODE.onbxdragstart=BX.delegate(this._onitemdragstart,this.items[t]);this.items[t].NODE.onbxdrag=BX.delegate(this._onitemdrag,this.items[t]);this.items[t].NODE.onbxdragstop=BX.delegate(this._onitemdragstop,this.items[t]);jsDD.registerObject(this.items[t].NODE)}var e=this.items[t].NODE.getAttribute("data-type");switch(e){case"submenu-item":BX.bind(this.items[t].NODE,"mouseover",BX.proxy(this._item_onmouseover,this.items[t]));BX.bind(this.items[t].NODE,"mouseout",BX.proxy(this._item_onmouseout,this.items[t]));break}};BX.adminMenu.prototype.registerItem=function(t,e){this.items.push({ID:t,CONFIG:e});if(BX.isReady){this._registerItem(this.items.length-1)}};BX.adminMenuResizer=function(t,e){this.node=t;this.bMinimized=!!e;this.min_width=70;this.denySave=false;this.scrollLeft=0;this.pos=this.pos_final=parseInt(this.node.getAttribute("data-width"))||parseInt(BX.style(this.node,"width"));this.dragger=document.body.appendChild(BX.create("DIV",{props:{className:"adm-resize-block"+(this.bMinimized?" adm-resize-block-close":"")},events:{mouseover:function(){if(!this.bDrag){var t=this;t.bxover=true;setTimeout((function(){if(t.bxover&&!t.bDrag)BX.addClass(t,"adm-resize-block-hover")}),100)}},mouseout:function(){var t=this;t.bxover=false;setTimeout((function(){if(!t.bxover)BX.removeClass(t,"adm-resize-block-hover")}),50)}},style:{left:(this.bMinimized?10:this.pos_final-5)+"px"}}));this.minimizer=this.dragger.appendChild(BX.create("DIV",{props:{className:"adm-resizer-btn"+(this.bMinimized?" adm-resizer-btn-close":"")},style:{left:(this.bMinimized?10:this.pos_final-5)+"px"},events:{click:BX.proxy(this.Minimize,this),mousedown:BX.eventCancelBubble}}));BX.bind(this.dragger,"dblclick",BX.proxy(this.Minimize,this));this.dragger.onbxdragstart=BX.delegate(this.Start,this);this.dragger.onbxdrag=BX.delegate(this.Drag,this);this.dragger.onbxdragstop=BX.delegate(this.Save,this);jsDD.registerObject(this.dragger);BX.bind(window,"scroll",BX.delegate(this.setDraggerPos,this));BX.bind(window,"resize",BX.delegate(this.setDraggerPos,this));this.setDraggerPos()};BX.adminMenuResizer.prototype.setDraggerPos=function(){this.scrollLeft=BX.GetWindowScrollPos().scrollLeft;this.dragger.style.left=this.minimizer.style.left=(this.bMinimized?10:this.pos-5)-this.scrollLeft+"px"};BX.adminMenuResizer.prototype.Start=function(){if(this.bMinimized)BX.removeClass(BX.firstChild(this.node),"adm-main-menu-close");BX.setUnselectable(document.body);document.body.style.cursor="e-resize";this.dragger.bDrag=true;BX.removeClass(this.dragger,"adm-resize-block-hover")};BX.adminMenuResizer.prototype.Drag=function(t,e){if(t>=this.min_width||this.bMinimized){this.denySave=t<this.min_width;BX.removeClass(this.dragger,"adm-resize-block-close");BX.removeClass(this.minimizer,"adm-resizer-btn-close");if(this.bMinimized&&!this.denySave){BX.removeClass(this.node,"adm-left-side-wrap-close");this.bMinimized=false}this.pos=t;this.node.style.width=this.pos+"px";this.setDraggerPos()}else if(!this.bMinimized){this.Minimize();jsDD.stopCurrentDrag()}BX.onCustomEvent(BX.adminMenu,"onAdminMenuResize",[this.pos])};BX.adminMenuResizer.prototype.Save=function(){this.dragger.bDrag=false;if(!this.denySave&&!this.bMinimized){this.pos_final=this.pos}if(this.denySave){if(this.bMinimized)this.Maximize();this.denySave=false}if(!this.denySave){BX.onCustomEvent(BX.adminMenu,"onAdminMenuResize",[this.pos]);BX.setSelectable(document.body);document.body.style.cursor="";if(window.onresize)window.onresize();if(!this.bMinimized)BX.userOptions.save("admin_menu","pos","width",this.pos_final);BX.userOptions.save("admin_menu","pos","ver",this.bMinimized?"off":"on")}};BX.adminMenuResizer.prototype.Minimize=function(){if(this.bMinimized)return this.Maximize();BX.addClass(this.minimizer,"adm-resizer-btn-animate");BX.addClass(this.node,"adm-left-side-wrap-close");var t=new BX.easing({duration:400,start:{width:this.pos},finish:{width:15},transition:BX.easing.makeEaseOut(BX.easing.transitions.quart),step:BX.delegate((function(t){this.node.style.width=t.width+"px";this.dragger.style.left=this.minimizer.style.left=t.width-5-this.scrollLeft+"px";BX.onCustomEvent(BX.adminMenu,"onAdminMenuResize",[t.width])}),this),complete:BX.delegate((function(){this.pos=this.pos_final;BX.addClass(this.minimizer,"adm-resizer-btn-close");BX.removeClass(this.minimizer,"adm-resizer-btn-animate");BX.addClass(this.dragger,"adm-resize-block-close");BX.addClass(BX.firstChild(this.node),"adm-main-menu-close");BX.onCustomEvent(BX.adminMenu,"onAdminMenuResize",[this.pos])}),this)});t.animate();this.bMinimized=true;this.Save()};BX.adminMenuResizer.prototype.Maximize=function(){BX.addClass(this.minimizer,"adm-resizer-btn-animate");BX.removeClass(this.node,"adm-left-side-wrap-close");BX.removeClass(this.dragger,"adm-resize-block-close");BX.removeClass(BX.firstChild(this.node),"adm-main-menu-close");var t=new BX.easing({duration:400,start:{width:this.pos<this.min_width?this.pos:15},finish:{width:this.pos_final},transition:BX.easing.makeEaseOut(BX.easing.transitions.quart),step:BX.delegate((function(t){this.node.style.width=t.width+"px";this.dragger.style.left=this.minimizer.style.left=t.width-5-this.scrollLeft+"px";BX.onCustomEvent(BX.adminMenu,"onAdminMenuResize",[t.width])}),this),complete:BX.delegate((function(){BX.removeClass(this.minimizer,"adm-resizer-btn-close");BX.removeClass(this.minimizer,"adm-resizer-btn-animate");BX.onCustomEvent(BX.adminMenu,"onAdminMenuResize",[15])}),this)});t.animate();this.bMinimized=false;this.Save()};BX.adminFav={url:"/bitrix/admin/favorite_act.php",lastId:null,add:function(t,e,i,s,a){var n=BX.adminFav.url+"?act=add&lang="+BX.message("LANGUAGE_ID"),o={sessid:BX.bitrix_sessid(),name:t};if(e)o.addurl=e;if(i)o.menu_id=i;if(BX.type.isFunction(s)){a=s;s=""}if(s){o.module_id=s}if(!a){a=function(t){if(t){BX.adminFav.refresh(t);alert(BX.message("JSADM_FAV_ADD_SUC"))}else{alert(BX.message("JSADM_FAV_ADD_ERR"))}}}return BX.ajax.post(n,o,a)},del:function(t,e){var i=BX.adminFav.url+"?act=delete&id="+t,s={sessid:BX.bitrix_sessid()};if(!e){e=function(t){if(t){BX.adminFav.refresh(t);alert(BX.message("JSADM_FAV_DEL_SUC"))}else{alert(BX.message("JSADM_FAV_DEL_ERR"))}}}return BX.ajax.post(i,s,e)},refresh:function(t){if(!t)return;var e=BX("_global_menu_desktop")?BX("_global_menu_desktop"):top.BX("_global_menu_desktop");e.innerHTML=t;BX.adminFav.setActiveItem()},setActiveItem:function(){var t=BX("menucontainer");var e=BX.findChild(t,{className:"adm-submenu-item-active"},true);if(!e)return false;var i=BX.findChild(e,{className:"adm-submenu-item-name-link"},true).href;var s=BX.findChild(e,{className:"adm-submenu-item-name-link-text"},true);var a=s.textContent||s.innerText;a=BX.util.trim(a);var n=BX("_global_menu_desktop");var o=BX.findChildren(n,{className:"adm-sub-submenu-block"},true);for(var r in o){var l=BX.findChild(o[r],{className:"adm-submenu-item-name-link"},true).href;var d=BX.findChild(o[r],{className:"adm-submenu-item-name-link-text"},true);var h=d.textContent||d.innerText;h=BX.util.trim(h);if(l==i&&i!="javascript:void(0)"){BX.addClass(o[r],"adm-submenu-item-active");return true}if(a&&a==h){BX.addClass(o[r],"adm-submenu-item-active");return true}}return false},setLastId:function(t){BX.adminFav.lastId=t},titleLinkClick:function(t,e,i){BX.adminFav.titleLink=t;BX.adminFav.titleNode=t.parentNode;if(!t.BXFAVSET){t.BXFAVID=e;t.BXITEMSID=i;if(!!t.BXFAVID)BX.adminFav._titleLinkClickDel();else BX.adminFav._titleLinkClickAdd();t.BXFAVSET=true}},_titleLinkClickAdd:function(){BX.adminFav.add(BX.adminFav.titleNode.textContent||BX.adminFav.titleNode.innerText,BX.adminHistory.pushSupported?window.location.pathname+window.location.search:BX("navchain-link").getAttribute("href"),BX.adminFav.titleLink.BXITEMSID,"",(function(t){if(t){BX.adminFav.refresh(t);BX.adminFav.titleLink.BXFAVID=BX.adminFav.lastId;BX.addClass(BX.adminFav.titleLink,"adm-fav-link-active");BX.adminFav.titleLink.title=BX.message("JSADM_FAV_DEL");BX.unbind(BX.adminFav.titleLink,"click",BX.adminFav._titleLinkClickAdd);BX.bind(BX.adminFav.titleLink,"click",BX.adminFav._titleLinkClickDel)}else{alert(BX.message("JSADM_FAV_ADD_ERR"))}}))},_titleLinkClickDel:function(){BX.adminFav.del(BX.adminFav.titleLink.BXFAVID,(function(t){if(t){BX.adminFav.refresh(t);BX.removeClass(BX.adminFav.titleLink,"adm-fav-link-active");BX.adminFav.titleLink.removeAttribute("data-fav-id");BX.adminFav.titleLink.title=BX.message("JSADM_FAV_ADD");BX.unbind(BX.adminFav.titleLink,"click",BX.adminFav._titleLinkClickDel);BX.bind(BX.adminFav.titleLink,"click",BX.adminFav._titleLinkClickAdd)}else{alert(BX.message("JSADM_FAV_DEL_ERR"))}}))},onMenuChange:function(){if(BX.adminMenu.activeSection=="desktop")BX.userOptions.save("favorite","favorite_menu","stick","Y");else BX.userOptions.save("favorite","favorite_menu","stick","N")},showDDBlock:function(t,e){if(!t.BXVISIBLE){t.style.display="";var i={property:0},s={property:-100},a="translate(",n="%,0)",o=BX.browser.isPropertySupported("transform");if(BX.browser.IsIE10()){i.property=0;s.property=33;o="right";a="";n="%"}else if(!o||BX.browser.IsFirefox()){i.property=-33;s.property=0;o="right";a="";n="%"}var r=new BX.easing({duration:500,start:i,finish:s,complete:e,transition:BX.easing.makeEaseInOut(BX.easing.transitions.quart),step:function(e){t.style[o]=a+e.property+n}});r.animate();t.BXVISIBLE=true}},hideDDBlock:function(t,e){if(t.BXVISIBLE){var i={property:-100},s={property:0},a="translate(",n="%,0)",o=BX.browser.isPropertySupported("transform");if(BX.browser.IsIE10()){i.property=33;s.property=-2;o="right";a="";n="%"}else if(!o||BX.browser.IsFirefox()){i.property=0;s.property=-35;o="right";a="";n="%"}var r=new BX.easing({duration:500,start:i,finish:s,complete:function(){t.style.display="none";if(e)e()},transition:BX.easing.makeEaseInOut(BX.easing.transitions.quart),step:function(e){t.style[o]=a+e.property+n}});r.animate();t.BXVISIBLE=false}},closeHint:function(t){t.parentNode.style.display="none";BX.userOptions.save("favorites_menu","hint","hide","Y")}};BX.adminList=function(t,e){this.table_id=t;this.params={context_ctrl:!!(e||{}).context_ctrl,context_menu:!!(e||{}).context_menu,FIX_HEADER:!!(e||{}).FIX_HEADER,FIX_FOOTER:!!(e||{}).FIX_FOOTER};this.TABLE=null;this.CHECKBOX=[];this.CHECKBOX_DISABLED=[];this.CHECKBOX_COUNTER=null;this.num_checked=0;this.bSelectAllChecked=false;this._last_row=null;BX.ready(BX.defer(this.Init,this));BX.garbage(BX.proxy(this.Destroy,this))};BX.adminList.prototype.Init=function(){this.TABLE=BX(this.table_id);this.LAYOUT=BX(this.table_id+"_result_div");this.FOOTER=BX(this.table_id+"_footer");this.FOOTER_EDIT=BX(this.table_id+"_footer_edit");this.FORM=document.forms["form_"+this.table_id];this.CHECKBOX_COUNTER=BX(this.table_id+"_selected_count");this.BUTTON_EDIT=BX("action_edit_button");this.BUTTON_DELETE=BX("action_delete_button");if(!!this.FORM){this.ACTION_SELECTOR=this.FORM.elements.action;this.ACTION_BUTTON=this.FORM.elements.apply;this.ACTION_TARGET=this.FORM.elements.action_target;if(this.ACTION_SELECTOR){BX.bind(this.ACTION_SELECTOR,"change",BX.proxy(this.UpdateCheckboxCounter,this))}if(this.ACTION_TARGET){BX.bind(this.ACTION_TARGET,"click",BX.proxy(this.UpdateCheckboxCounter,this))}}if(!!this.TABLE&&this.TABLE.tBodies[0]&&this.TABLE.tBodies[0].rows.length>0){for(var t=0;t<this.TABLE.tBodies[0].rows.length;t++){if(this.TABLE.tBodies[0].rows[t].oncontextmenu){BX.bind(this.TABLE.tBodies[0].rows[t],"contextmenu",BX.proxy((function(t){if(!this.params.context_menu)return;t=t||window.event;if(!this.params.context_ctrl&&t.ctrlKey||this.params.context_ctrl&&!t.ctrlKey||t.target&&t.target.tagName.toUpperCase()=="A")return;BX.adminList.ShowMenu({x:t.pageX||t.clientX+document.body.scrollLeft,y:t.pageY||t.clientY+document.body.scrollTop},BX.proxy_context.oncontextmenu(),BX.proxy_context);return BX.PreventDefault(t)}),this))}BX.bind(this.TABLE.tBodies[0].rows[t],"click",BX.proxy(this.RowClick,this))}}var e=BX.findChildren(this.LAYOUT||this.TABLE,{tagName:"INPUT",property:{type:"checkbox"}},true);if(!!e){for(t=0;t<e.length;t++){BX.adminFormTools.modifyCheckbox(e[t]);if(e[t].name=="ID[]"){if(!e[t].disabled){BX.bind(e[t],"click",BX.proxy(this._checkboxClick,this));BX.bind(e[t].parentNode,"click",BX.proxy(this._checkboxCellClick,this));BX.bind(e[t].parentNode,"dblclick",BX.PreventDefault);this.CHECKBOX.push(e[t])}else{this.CHECKBOX_DISABLED.push(e[t])}}}}var i=BX(this.table_id+"_check_all");if(this.TABLE&&this.TABLE.tHead&&!!this.params.FIX_HEADER){if(i){i.checked=false;this.bSelectAllChecked=false;var s=i.id;BX.addCustomEvent(this.TABLE.tHead,"onFixedNodeChangeState",BX.delegate((function(t){if(t){i.setAttribute("id","");setTimeout("BX('"+s+"').checked="+this.table_id+".bSelectAllChecked",5)}else{i.checked=this.bSelectAllChecked;i.setAttribute("id",s)}}),this))}BX.Fix(this.TABLE.tHead,{type:"top",limit_node:this.TABLE})}if(this.FOOTER||this.FOOTER_EDIT){BX.adminFormTools.modifyFormElements(this.FOOTER||this.FOOTER_EDIT,["*"]);if(!!this.params.FIX_FOOTER){BX.addCustomEvent(this.FOOTER||this.FOOTER_EDIT,"onFixedNodeChangeState",(function(t){if(t)BX.addClass(this,"adm-list-table-footer-fixed");else BX.removeClass(this,"adm-list-table-footer-fixed")}))}}if(this.FOOTER_EDIT){if(!!this.params.FIX_FOOTER){BX.Fix(this.FOOTER_EDIT,{type:"bottom",limit_node:this.TABLE})}BX.bindDelegate(this.FOOTER_EDIT,"click",{property:{type:/button|submit/}},BX.adminPanel.showWait)}if(!!this.LAYOUT){var a=BX.pos(this.LAYOUT),n=BX.GetWindowSize();if(BX.adminPanel.isFixed()&&BX.adminPanel.panel){a.top-=BX.adminPanel.panel.offsetHeight}if(!!this.FOOTER_EDIT){if(!!this.CHECKBOX_DISABLED[0]){a=BX.pos(this.CHECKBOX_DISABLED[0].parentNode)}window.scrollTo(n.scrollLeft,a.top-parseInt(n.innerHeight/2))}else if(a.top<n.scrollTop){window.scrollTo(n.scrollLeft,a.top)}}this.UpdateCheckboxCounter()};BX.adminList.prototype.ReInit=function(){BX.defer(this.Init,this)()};BX.adminList.prototype.GetAdminList=function(t,e){t=BX.util.add_url_param(t,{mode:"list",table_id:BX.util.urlencode(this.table_id)});BX.ajax({method:"GET",dataType:"html",url:t,onsuccess:BX.delegate((function(i){if(i.length>0){BX.closeWait(this.LAYOUT);BX.onCustomEvent(window,"onAdminListLoaded");this._GetAdminList(i);if(e&&BX.type.isFunction(e))e(t)}}),this),onfailure:function(){BX.debug("GetAdminList",arguments)}})};BX.adminList.prototype._GetAdminList=function(t){BX.adminPanel.closeWait();this.Destroy();this.LAYOUT.innerHTML=t;this.ReInit();BX.adminChain.addItems(this.table_id+"_navchain_div")};BX.adminList.prototype.PostAdminList=function(t){t=BX.util.remove_url_param(t,["mode","table_id"]);t+=(t.indexOf("?")>=0?"&":"?")+"mode=frame&table_id="+BX.util.urlencode(this.table_id);try{this.FORM.action.parentNode.removeChild(this.FORM.action)}catch(t){}this.FORM.action=t;BX.submit(this.FORM)};BX.adminList.prototype.UpdateCheckboxCounter=function(){if(!this.CHECKBOX_COUNTER)return;var t=this.num_checked>0||this.ACTION_TARGET&&this.ACTION_TARGET.checked;if(!t){if(!!this.FOOTER&&!!this.params.FIX_FOOTER)BX.UnFix(this.FOOTER);BX.removeClass(this.CHECKBOX_COUNTER,"adm-table-counter-visible");this.CHECKBOX_COUNTER.lastChild.innerHTML="0";if(!!this.ACTION_BUTTON)this.ACTION_BUTTON.disabled=true}else{if(!!this.FOOTER&&!!this.params.FIX_FOOTER)BX.Fix(this.FOOTER,{type:"bottom",limit_node:this.TABLE.tBodies[0]});BX.addClass(this.CHECKBOX_COUNTER,"adm-table-counter-visible");this.CHECKBOX_COUNTER.lastChild.innerHTML=this.ACTION_TARGET&&this.ACTION_TARGET.checked?BX.message("JSADM_LIST_SELECTEDALL"):this.num_checked;if(!!this.ACTION_BUTTON)this.ACTION_BUTTON.disabled=this.ACTION_SELECTOR.selectedIndex<=0}};BX.adminList.prototype.Sort=function(t,e,i){if(e==true){var s=null,a=false;if(i.length>0)s=i[0];if(!s)s=window.event;if(s)a=s.ctrlKey;t+=a?"desc":"asc"}this.GetAdminList(t)};BX.adminList.prototype.RowClick=function(t){t=t||window.event;if(t.button!=0)return true;if(t.ctrlKey||t.metaKey||t.shiftKey&&!this._last_row){var e=BX.proxy_context.cells[0].firstChild;e.checked=!e.checked;this.SelectRow(e,e.checked);this.UpdateCheckboxCounter();this.EnableActions()}if(t.shiftKey){if(!this._last_row)this._last_row=BX.proxy_context.parentNode.rows[0];var i=this._last_row.parentNode,s=Math.min(this._last_row.rowIndex,BX.proxy_context.rowIndex),a=Math.max(this._last_row.rowIndex,BX.proxy_context.rowIndex);for(var n=s;n<=a;n++){e=i.rows[n-1].cells[0].firstChild;if(!e.checked){e.checked=true;this.SelectRow(e,e.checked)}}this.UpdateCheckboxCounter();this.EnableActions();return BX.PreventDefault(t)}};BX.adminList.prototype._checkboxClick=function(t){if(t.shiftKey||t.ctrlKey||t.metaKey)return true;this.SelectRow(BX.proxy_context,BX.proxy_context.checked);this.UpdateCheckboxCounter();this.EnableActions();return BX.eventCancelBubble(t)};BX.adminList.prototype._checkboxCellClick=function(t){if(t.shiftKey||t.ctrlKey||t.metaKey)return true;var e=BX.proxy_context.firstChild;e.checked=!e.checked;this.SelectRow(e,e.checked);this.UpdateCheckboxCounter();this.EnableActions();return BX.PreventDefault(t)};BX.adminList.prototype.SelectRow=function(t,e){if(t.tagName.toUpperCase()!="TR"){if(!t.BXROW){t.BXROW=BX.findParent(t,{tag:"TR"})}if(!!t.BXROW){this.SelectRow(t.BXROW,e)}}else{if(e)BX.addClass(t,"adm-table-row-active");else BX.removeClass(t,"adm-table-row-active");this._last_row=t;this.num_checked+=e?1:-1}};BX.adminList.prototype.SelectAllRows=function(t){this.bSelectAllChecked=!!t.checked;for(var e=0;e<this.CHECKBOX.length;e++){if(this.CHECKBOX[e].checked!=this.bSelectAllChecked&&!this.CHECKBOX[e].disabled){this.CHECKBOX[e].checked=this.bSelectAllChecked;this.SelectRow(this.CHECKBOX[e],this.bSelectAllChecked)}}this.UpdateCheckboxCounter();this.EnableActions()};BX.adminList.prototype.IsActionEnabled=function(t){if(t=="edit")return!(this.ACTION_TARGET&&this.ACTION_TARGET.checked)&&this.num_checked>0;else return this.ACTION_TARGET&&this.ACTION_TARGET.checked||this.num_checked>0};BX.adminList.prototype.EnableActions=function(){if(!!this.BUTTON_EDIT){if(this.IsActionEnabled("edit"))BX.removeClass(this.BUTTON_EDIT,"adm-edit-disable");else BX.addClass(this.BUTTON_EDIT,"adm-edit-disable")}if(!!this.BUTTON_DELETE){if(this.IsActionEnabled("delete"))BX.removeClass(this.BUTTON_DELETE,"adm-edit-disable");else BX.addClass(this.BUTTON_DELETE,"adm-edit-disable")}};BX.adminList.prototype.Destroy=function(){this.CHECKBOX=[];this.CHECKBOX_DISABLED=[];if(BX.PopupMenu.currentItem&&BX.PopupMenu.currentItem.popupWindow.isShown())BX.PopupMenu.currentItem.popupWindow.close();if(this.TABLE&&this.TABLE.tHead)BX.UnFix(this.TABLE.tHead);if(this.FOOTER)BX.UnFix(this.FOOTER);if(this.FOOTER_EDIT)BX.UnFix(this.FOOTER_EDIT);this._last_row=null;this.num_checked=0};BX.adminList.prototype.ShowSettings=function(t){new BX.CDialog({content_url:t,resizable:true,height:475,width:560}).Show()};BX.adminList.prototype.SaveSettings=function(t){var e="",i="",s="",a;var n=document.list_settings.selected_columns;var o=n.length;for(var r=0;r<o;r++)e+=(e!=""?",":"")+n[r].value;n=document.list_settings.order_field;if(n)i=n[n.selectedIndex].value;n=document.list_settings.order_direction;if(n)s=n[n.selectedIndex].value;n=document.list_settings.nav_page_size;a=n[n.selectedIndex].value;var l=document.list_settings.set_default&&document.list_settings.set_default.checked;BX.userOptions.save("list",this.table_id,"columns",e,l);BX.userOptions.save("list",this.table_id,"by",i,l);BX.userOptions.save("list",this.table_id,"order",s,l);BX.userOptions.save("list",this.table_id,"page_size",a,l);var d=window.location.href;BX.WindowManager.Get().showWait(t);BX.userOptions.send(BX.delegate((function(){this.GetAdminList(d,(function(){BX.WindowManager.Get().closeWait(t);BX.WindowManager.Get().Close()}))}),this))};BX.adminList.prototype.DeleteSettings=function(t){BX.showWait();var e=window.location.href;BX.userOptions.del("list",this.table_id,t,BX.delegate((function(){BX.closeWait();this.GetAdminList(e,(function(){BX.WindowManager.Get().Close()}))}),this))};BX.adminList._onpopupmenushow=function(){BX.addClass(this,"adm-list-row-active")};BX.adminList._onpopupmenuclose=function(){BX.removeClass(this,"adm-list-row-active")};BX.adminList.ShowMenu=function(t,e,i){if(!!e&&e.length>0){if(!!i){BX.addCustomEvent(t,"onAdminMenuShow",BX.proxy(BX.adminList._onpopupmenushow,i));BX.addCustomEvent(t,"onAdminMenuClose",BX.proxy(BX.adminList._onpopupmenuclose,i))}var s={active_class:"adm-list-table-popup-active"};var a=window.location.search;if(a.indexOf("IFRAME_TYPE=PUBLIC_FRAME")!==-1||a.indexOf("IFRAME_TYPE%3DPUBLIC_FRAME")!==-1){s.public_frame="1"}BX.adminShowMenu(t,e,s)}};BX.adminList.showPublicMenu=function(t,e){var i=[];if(e.length){for(var s=0;s<e.length;s++){var a={text:e[s].TEXT};if(BX.type.isNotEmptyString(e[s].ONCLICK)){a["onclick"]=e[s].ONCLICK}else if(BX.type.isNotEmptyString(e[s].LINK)){a["href"]=e[s].LINK}if(BX.type.isArray(e[s].MENU)&&e[s].MENU.length){var n=[],o=e[s].MENU;o.forEach((function(t){var e={text:t.TEXT};if(BX.type.isNotEmptyString(t.ONCLICK)){e["onclick"]=t.ONCLICK}else if(BX.type.isNotEmptyString(t.LINK)){e["href"]=t.LINK}n.push(e)}),this);if(n.length){a["items"]=n}}i.push(a)}}var r=t.getBoundingClientRect();var l=BX.PopupMenu.create("context-menu-"+BX.util.getRandomString(3),t,i,{closeByEsc:true,angle:true,offsetLeft:r.width/2,zIndex:-3});if(l){l.popupWindow.show()}};BX.adminUiFilter=function(t,e){this.filterId=t;this.init()};BX.adminUiFilter.prototype.init=function(){BX.addCustomEvent("BX.Main.Filter:apply",this.onApplyFilter);BX.addCustomEvent("BX.Main.Filter:show",this.onShow)};BX.adminUiFilter.prototype.onApplyFilter=function(t,e,i,s,a){if(!i.grid||i.grid&&!(i.grid instanceof BX.Main.grid)){a.autoResolve=false;BX.ajax.post(window.location.toString(),{},(function(t){s.fulfill();window.location.reload()}))}};BX.adminUiFilter.prototype.onShow=function(t){BX.onCustomEvent(window,"onAdminFilterInited",[{filterId:this.filterId}])};BX.adminUserFilterHandler=function(t){this.filterId=t.filterId;this.fieldId=t.fieldId;this.languageId=t.languageId;this.selfFolderUrl=t.selfFolderUrl;this.init()};BX.adminUserFilterHandler.prototype.init=function(){this.control=null;this.userSearchWindow=null;BX.addCustomEvent(window,"BX.Main.Filter:customEntityFocus",BX.proxy(this.onCustomEntitySelectorOpen,this))};BX.adminUserFilterHandler.prototype.openWindow=function(){var t=this.selfFolderUrl+"user_search.php?lang="+this.languageId+"&JSFUNC=setUserId_"+this.fieldId,e="scrollbars=yes,resizable=yes,width=760,height=500,top="+Math.floor((screen.height-560)/2-14)+",left="+Math.floor((screen.width-760)/2-5);this.userSearchWindow=window.open(t,"",e);if(this.userSearchWindow){this.userSearchWindow.onbeforeunload=function(t){setTimeout(function(){this.userSearchWindow=null}.bind(this),300)}.bind(this)}};BX.adminUserFilterHandler.prototype.closeWindow=function(){this.userSearchWindow.close();setTimeout(function(){this.userSearchWindow=null}.bind(this),300)};BX.adminUserFilterHandler.prototype.setSelected=function(t){if(this.control){var e=this.control.getLabelNode();e.value="";BX.ajax.post(this.selfFolderUrl+"get_user.php",{ID:t,ajax:"Y",format:"Y",sessid:BX.bitrix_sessid()},BX.proxy((function(e){e=BX.parseJSON(e,{});var i=t;if(e["NAME"]){i=e["NAME"]}this.control.setData(i,t)}),this));this.closeWindow()}};BX.adminUserFilterHandler.prototype.onCustomEntitySelectorOpen=function(t){if(!this.userSearchWindow&&t.getId()===this.fieldId){this.control=t;this.openWindow()}};BX.adminProductFilterHandler=function(t){this.filterId=t.filterId;this.fieldId=t.fieldId;this.languageId=t.languageId;this.publicMode=t.publicMode;this.selfFolderUrl=t.selfFolderUrl;this.init()};BX.adminProductFilterHandler.prototype.init=function(){BX.addCustomEvent(window,"BX.Main.Filter:customEntityFocus",BX.proxy(this.onCustomEntitySelectorOpen,this));this.control=null;this.popup=null};BX.adminProductFilterHandler.prototype.onCustomEntitySelectorOpen=function(t){if(t.getId()===this.fieldId){this.control=t;this.showProductSearchDialog()}};BX.adminProductFilterHandler.prototype.showProductSearchDialog=function(){this.popup=this.makeProductSearchDialog({caller:this.fieldId,lang:this.languageId,callback:"FillProductFields_"+this.fieldId});var t=this.popup.GetContent();BX.bind(t.parentNode.parentNode,"mousedown",(function(t){t.stopPropagation()}));this.popup.Show()};BX.adminProductFilterHandler.prototype.makeProductSearchDialog=function(t){var e=t.caller||"",i=t.lang||"ru",s=t.siteId||"",a=t.callback||"",n=t.storeId||"0",o="/bitrix/tools/sale/product_search_dialog.php?lang="+i+"&LID="+s+"&caller="+e+"&func_name="+a+"&STORE_FROM_ID="+n;if(this.publicMode==="Y"){o=o+"&public_mode=Y"}var r=new BX.CDialog({content_url:o,height:Math.max(500,window.innerHeight-400),width:Math.max(800,window.innerWidth-400),draggable:true,resizable:true,min_height:500,min_width:800,zIndex:2e3});BX.addCustomEvent(r,"onWindowRegister",BX.defer((function(){r.Get().style.position="fixed";r.Get().style.top=parseInt(r.Get().style.top)-BX.GetWindowScrollPos().scrollTop+"px"})));return r};BX.adminProductFilterHandler.prototype.closeProductSearchDialog=function(){if(this.popup){this.popup.Close()}};BX.adminProductFilterHandler.prototype.setSelected=function(t,e){if(this.control){var i=this.control.getLabelNode();i.value="";this.control.setData(e,t)}};BX.adminUiList=function(t,e){this.gridId=t;this.publicMode=e.publicMode?e.publicMode:false;this.showTotalCountHtml=e.showTotalCountHtml?e.showTotalCountHtml:false;this.serviceUrl=e.serviceUrl?e.serviceUrl:"";this.init()};BX.adminUiList.prototype.init=function(){this.basePageUrl=window.location.pathname;this.serviceUrl=this.serviceUrl?this.serviceUrl:this.basePageUrl;this.gridUrl=window.location.pathname+window.location.search;BX.addCustomEvent("SidePanel.Slider:onMessage",BX.proxy(this.onMessage,this));BX.addCustomEvent("AdminUiList:onReloadGrid",BX.proxy(this.onReloadGrid,this));BX.addCustomEvent(window,"Grid::beforeRequest",BX.proxy(this.onBeforeRequest,this));BX.addCustomEvent(window,"Grid::updated",BX.proxy(this.onUpdated,this));this.bindShowTotalCount()};BX.adminUiList.prototype.onUpdated=function(t){this.bindShowTotalCount()};BX.adminUiList.prototype.bindShowTotalCount=function(){if(this.showTotalCountHtml){BX.bind(BX(this.gridId+"_show_total_count"),"click",BX.proxy(this.onShowTotalCount,this))}};BX.adminUiList.prototype.onShowTotalCount=function(t){BX.ajax({url:this.serviceUrl,method:"POST",dataType:"json",data:{action:"getTotalCount"},onsuccess:BX.proxy((function(t){if(t.hasOwnProperty("totalCountHtml")){BX(this.gridId+"_show_total_count").parentElement.innerHTML=t.totalCountHtml}}),this)});t.preventDefault()};BX.adminUiList.prototype.onMessage=function(t){if(!(t instanceof BX.SidePanel.MessageEvent)&&!(t instanceof top.BX.SidePanel.MessageEvent)){return}var e=BX.type.isPlainObject(t.getData())?t.getData():{};if(e.hasOwnProperty("listActions")&&e.listActions.length){e.listActions.forEach((function(t){switch(t){case"reloadTopPage":var i=this.basePageUrl;if(e["reloadTopUrlParams"]){i=i+e["reloadTopUrlParams"]}window.location.href=i;break}}),this)}else{var i=t.getEventId(),s=["cancel","dontsave"];if(BX.util.in_array(i,s)){return}}this.onReloadGrid()};BX.adminUiList.prototype.onReloadGrid=function(){var t={apply_filter:"Y"};var e;if(BX.Reflection.getClass("top.BX.Main.gridManager.getById")){e=top.BX.Main.gridManager.getById(this.gridId)}if(e===null&&BX.Reflection.getClass("BX.Main.gridManager.getById")){e=BX.Main.gridManager.getById(this.gridId)}if(e&&e.hasOwnProperty("instance")){e.instance.reloadTable("POST",t,false,this.gridUrl)}};BX.adminUiList.prototype.onBeforeRequest=function(t,e){if(BX.type.isPlainObject(e.data)){var i=e.data;e.data=this.getDataWithPreparedCustomFields(i)}if(this.publicMode){e.url=BX.util.add_url_param(e.url,{sessid:BX.bitrix_sessid(),public:"Y"})}else{if(BX.type.isNotEmptyString(e.url)){e.url=e.url+(e.url.indexOf("?")<0?"":"&")+window.location.search.slice(1)}else{e.url=this.basePageUrl+window.location.search}}};BX.adminUiList.prototype.getDataWithPreparedCustomFields=function(t){if(BX.type.isPlainObject(t.FIELDS)){for(var e in t.FIELDS){var i=null;if(t.FIELDS.hasOwnProperty(e)){i=t.FIELDS[e]}if(BX.type.isPlainObject(i)){for(var s in i){if(i.hasOwnProperty(s)&&s.indexOf("_custom")!==-1){if(BX.type.isPlainObject(i[s])){var a={};Object.keys(i[s]).forEach((function(t,e){if(i[s].hasOwnProperty(t)){a[e]=a[e]||{};a[e]["name"]=t;a[e]["value"]=i[s][t]}}));i[s]=a;delete i[s.replace("_custom","")]}}}}}}return t};BX.adminUiList.SendSelected=function(t){var e=BX.Main.gridManager.getById(t).instance;var i=e.getActionsPanel().getValues();var s=e.getRows().getSelectedIds();var a=Object.assign({ID:s,action:i},i);e.reloadTable("POST",a)};BX.adminSidePanel=function(t){this.params=BX.type.isPlainObject(t)?t:{};this.publicMode=this.params.publicMode?Boolean(this.params.publicMode):false;this.init()};BX.adminSidePanel.prototype.init=function(){BX.addCustomEvent("AdminSidePanel:onSendRequest",BX.proxy(this.onSendRequest,this));BX.addCustomEvent("SidePanel.Slider:onMessage",BX.proxy(this.onMessage,this));this.checkActionByUrl()};BX.adminSidePanel.prototype.checkActionByUrl=function(){var t=window.location.search;if(t.indexOf("sidePanelAction=")!==-1||t.indexOf("sidePanelAction%3D")!==-1){var e=t.substring(1),i;if(BX.type.isNotEmptyString(e)){var s=e.split("&");for(var a=0;a<s.length;a++){var n=s[a].split("="),o=n[0];if(o==="sidePanelAction"){i=BX.type.isNotEmptyString(n[1])?n[1]:false;break}}if(i){var r={};switch(i){case"save":r["listActions"]=["destroy"];break;case"saveAndReload":r["listActions"]=["destroy","reloadTopPage"];t=t.replace("&IFRAME=Y&IFRAME_TYPE=SIDE_SLIDER&sidePanelAction="+i,"");r["reloadTopUrlParams"]=t;break;case"apply":t=t.replace("&sidePanelAction="+i,"");r["reloadCurrentUrlParams"]=t;r["listActions"]=["reloadCurrentPage"];break}top.BX.onCustomEvent("SidePanel:postMessage",[window,i,r])}}}};BX.adminSidePanel.prototype.onMessage=function(t){if(!(t instanceof top.BX.SidePanel.MessageEvent)){return}var e=t.getSender();var i=t.getSlider();var s=i?i.getWindow():window;var a=BX.type.isPlainObject(t.getData())?t.getData():{};var n=t.getEventId();if(!(e instanceof top.BX.SidePanel.Slider)||!n){return}if(a.hasOwnProperty("listActions")&&a.listActions.length){a.listActions.forEach((function(t){switch(t){case"closeAndOpen":e.close(true);if(a.hasOwnProperty("addUrl")&&BX.type.isNotEmptyString(a.addUrl))this.onOpenPage(a.addUrl);break;case"close":e.close(n==="save");break;case"destroy":e.destroy();break;case"reload":if(a.hasOwnProperty("formParams")&&a.formParams.hasOwnProperty("reloadUrl")){if(this.publicMode){a.formParams.reloadUrl=a.formParams.reloadUrl+(a.formParams.reloadUrl.indexOf("?")<0?"?":"&");if(a.formParams.reloadUrl.indexOf("publicSidePanel")<0){a.formParams.reloadUrl=a.formParams.reloadUrl+"publicSidePanel=Y"}}e.getWindow().location.href=a.formParams.reloadUrl}else{e.getWindow().location.reload()}break;case"reloadCurrentPage":if(a["reloadCurrentUrlParams"]){e.getWindow().location.search=a["reloadCurrentUrlParams"]}break}}),this)}else{switch(n){case"save":case"save_and_conduct":case"cancellation":e.destroy();break;case"save_and_add":e.close(true);if(a.hasOwnProperty("addUrl")&&BX.type.isNotEmptyString(a.addUrl))this.onOpenPage(a.addUrl);break;case"apply":case"save_document":break;case"cancel":case"dontsave":e.close(false);break}}var o=["save","apply","save_document","save_and_conduct"];if(i&&BX.util.in_array(n,o)){var r=i.getData(),l=r.get("adminTabControlInstance"),d={IFRAME:"Y",IFRAME_TYPE:"SIDE_SLIDER"};if(l){var h=s.BX(l.name+"_active_tab")?s.BX(l.name+"_active_tab").value:null;if(h){d[l.name+"_active_tab"]=h;s.location.href=BX.util.add_url_param(i.getUrl(),d)}else{s.location.reload()}}}};BX.adminSidePanel.onOpenPage=BX.adminSidePanel.prototype.onOpenPage=function(t,e){if(top.BX.admin&&top.BX.admin.dynamic_mode_show_borders){return}if(top.BX.SidePanel.Instance){if(e){top.BX.SidePanel.Instance.open(t)}else{var i=top.window["adminSidePanel"],s={};if(i.publicMode){t=BX.util.add_url_param(t,{publicSidePanel:"Y"});s.allowChangeHistory=false}top.BX.SidePanel.Instance.open(t,s)}}};BX.adminSidePanel.setDefaultQueryParams=BX.adminSidePanel.prototype.setDefaultQueryParams=function(t){if(t.indexOf("IFRAME")===-1){t=BX.util.add_url_param(t,{IFRAME:"Y"})}if(t.indexOf("IFRAME_TYPE")===-1){t=BX.util.add_url_param(t,{IFRAME_TYPE:"SIDE_SLIDER"})}var e=top.window["adminSidePanel"];if(e&&e.publicMode){t=BX.util.add_url_param(t,{publicSidePanel:"Y"})}return t};BX.adminSidePanel.prototype.onSendRequest=function(t){if(!BX.type.isNotEmptyString(t)){return}var e={};BX.ajax.post(BX.adminSidePanel.setDefaultQueryParams(t),{sessid:BX.bitrix_sessid()},BX.delegate((function(t){t=BX.parseJSON(t,{});if(t&&t.status){if(t.status==="success"){if(t.hasOwnProperty("listActions"))e["listActions"]=BX.type.isArray(t["listActions"])?t["listActions"]:[];if(BX.SidePanel.Instance&&BX.SidePanel.Instance.getTopSlider()){top.BX.onCustomEvent("SidePanel:postMessage",[BX.SidePanel.Instance.getTopSlider().getWindow(),"request",e])}}else if(t.status==="error"){alert(t.message.replace(/<br>/gi,""))}}else{alert("Wrong response format")}}),this))};BX.adminTabControl=function(t,e,i,s){this.name=t;this.unique_name=e;this.form=null;this.aTabs=i;this.params=BX.type.isPlainObject(s)?s:{};this.backUrl=this.params.hasOwnProperty("backUrl")&&BX.type.isNotEmptyString(this.params.backUrl)?this.params.backUrl:null;this.isSidePanel=!!(this.params.hasOwnProperty("isSidePanel")&&BX.type.isNotEmptyString(this.params.isSidePanel)&&this.params.isSidePanel==="Y");this.isPublicFrame=!!(this.params.hasOwnProperty("isPublicFrame")&&BX.type.isNotEmptyString(this.params.isPublicFrame)&&this.params.isPublicFrame==="Y");this.publicSidePanel=!!(this.params.hasOwnProperty("publicSidePanel")&&BX.type.isNotEmptyString(this.params.publicSidePanel)&&this.params.publicSidePanel==="Y");this.isActiveConfirm=false;this.bInited=false;this.bFixed={top:true,bottom:true};this.bExpandTabs=false;this.aTabsDisabled={};this.bPublicMode=false;this.PreInit()};BX.adminTabControl.prototype.PreInit=function(t){for(var e=0;e<this.aTabs.length;e++){this.aTabs[e].CONTENT=BX(this.aTabs[e]["DIV"]);var i=BX(this.aTabs[e]["DIV"]+"_edit_table");if(!!i){for(var s=0;s<i.tBodies.length;s++){var a=i.tBodies[s].rows.length;for(var n=0;n<a;n++){if(i.tBodies[s].rows[n].cells.length>1){BX.addClass(i.tBodies[s].rows[n].cells[0],"adm-detail-content-cell-l");BX.addClass(i.tBodies[s].rows[n].cells[1],"adm-detail-content-cell-r")}}}this.aTabs[e].EDIT_TABLE=i;this.aTabs[e].CONTENT_BLOCK=i.parentNode;var o=BX.adminFormTools.modifyFormElements(i)}}if(!t){BX.ready(BX.defer(this.Init,this))}};BX.adminTabControl.prototype.Init=function(){if(this.aTabs&&this.aTabs.length>0){var t=this.TABS_BLOCK=BX(this.name+"_tabs");if(!!t){var e=BX(this.name+"_settings_btn");t.appendChild(BX.create("DIV",{props:{className:"adm-detail-pin-btn-tabs",title:BX.message("JSADM_PIN_OFF")},attrs:{onclick:this.name+".ToggleFix('top')"}}));BX.addCustomEvent(t,"onFixedNodeChangeState",(function(i){if(i){BX.addClass(t,"adm-detail-tabs-block-fixed")}else{BX.removeClass(t,"adm-detail-tabs-block-fixed")}if(!!e&&BX.hasClass(e,"bx-settings-btn-active")){BX.onCustomEvent(e,"onChangeNodePosition")}}));if(this.bFixed["top"]){BX.Fix(t,{type:"top",limit_node:t.parentNode})}else{BX.addClass(t,"adm-detail-tabs-block-pin");t.lastChild.title=BX.message("JSADM_PIN_ON")}}}var i=BX(this.name+"_buttons_div");if(!!i){if(i.firstChild){if(BX.util.trim(i.firstChild.innerHTML).length<=0){if(!BX.hasClass(i.firstChild,"adm-detail-content-btns-empty"))BX.addClass(i.firstChild,"adm-detail-content-btns-empty")}else{if(true){i.firstChild.insertBefore(BX.create("DIV",{props:{className:"adm-detail-pin-btn",title:BX.message("JSADM_PIN_OFF")},attrs:{onclick:this.name+".ToggleFix('bottom')"}}),i.firstChild.firstChild)}BX.addCustomEvent(i,"onFixedNodeChangeState",(function(t){if(t)BX.addClass(i,"adm-detail-content-btns-fixed");else BX.removeClass(i,"adm-detail-content-btns-fixed")}));if(this.bFixed["bottom"]){BX.Fix(i,{type:"bottom",limit_node:i.parentNode})}else{BX.addClass(i,"adm-detail-content-btns-pin");i.firstChild.firstChild.title=BX.message("JSADM_PIN_ON")}}if(this.isSidePanel){this.setFormDataForSidePanel();BX.bindDelegate(i,"click",{property:{type:/button/}},this.onClickSidePanelButtons.bind(this))}else{BX.bindDelegate(i,"click",{property:{type:/button|submit/}},BX.adminPanel.showWait)}}this.form=BX.findParent(i,{tag:"form"});if(this.isSidePanel&&this.form){BX.bind(this.form,"change",(function(){if(!this.isActiveConfirm){this.isActiveConfirm=true;BX.addCustomEvent("SidePanel.Slider:onCloseByEsc",(function(t){var e=/bitrix\/admin\//;var i=t.getSlider().getUrl();if(e.test(i)&&!confirm(BX.message("JSADM_SP_ON_CLOSE_BY_ESC"))){t.denyAction()}}))}}))}}this.bInited=true};BX.adminTabControl.prototype.setFormDataForSidePanel=function(){var t=top.BX.SidePanel?top.BX.SidePanel:BX.SidePanel,e,i;if(typeof t==="undefined"){return}if(!t.Instance){return}e=t.Instance.getSliderByWindow(window);if(e){i=e.getData();i.set("adminTabControlInstance",this)}t=null};BX.adminTabControl.prototype.onClickSidePanelButtons=function(t){var e=t.target,i=e.name;this.form=BX.findParent(e,{tag:"form"});if(!this.form){throw new Error("BX.adminTabControl: form not found.")}switch(i){case"save":case"apply":case"save_and_add":case"save_and_conduct":case"save_document":case"cancellation":this.submitAjax(i,e);break;case"cancel":case"dontsave":top.BX.onCustomEvent("SidePanel:postMessage",[window,i,{}]);break}};BX.adminTabControl.prototype.submitAjax=function(t,e){if(!t){throw new Error("BX.adminTabControl: buttonType not found.")}if(e){BX.adminPanel.showWait(e)}this.createEventTypeInput(t);var i={},s=this.form.getAttribute("action");if(this.publicSidePanel){s=BX.adminSidePanel.setDefaultQueryParams(s)}BX.ajax.submitAjax(this.form,{method:"POST",url:s,onsuccess:BX.delegate((function(s){s=BX.parseJSON(s,{});if(s&&s.status){if(s.status==="success"){if(s.hasOwnProperty("listActions"))i["listActions"]=BX.type.isArray(s["listActions"])?s["listActions"]:[];if(this.backUrl)i["backUrl"]=this.backUrl;if(e&&e.dataset.url)i["addUrl"]=e.dataset.url;var a=["apply","save_document","save_and_conduct"];if(BX.util.in_array(t,a)){if(s.hasOwnProperty("formParams")){i["formParams"]=s["formParams"];this.createFormParamsInput(s["formParams"])}}top.BX.onCustomEvent("SidePanel:postMessage",[window,t,i])}else if(s.status==="error"){alert(s.message.replace(/<br>/gi,""))}}else{alert("Wrong response format")}if(e){BX.adminPanel.closeWait(e)}}),this)})};BX.adminTabControl.prototype.createEventTypeInput=function(t){if(!this.form){throw new Error("BX.adminTabControl: form not found.")}if(BX(this.name+"_eventType")){BX(this.name+"_eventType").innerHTML="";BX(this.name+"_eventType").appendChild(BX.create("input",{attrs:{type:"hidden",name:t,value:"Y"}}))}else{this.form.appendChild(BX.create("div",{props:{id:this.name+"_eventType"},children:[BX.create("input",{attrs:{type:"hidden",name:t,value:"Y"}})]}))}};BX.adminTabControl.prototype.createFormParamsInput=function(t){if(!this.form){throw new Error("BX.adminTabControl: form not found.")}var e;t=BX.type.isPlainObject(t)?t:{};if(BX(this.name+"_formParams")){BX(this.name+"_formParams").innerHTML="";for(e in t){BX(this.name+"_formParams").appendChild(BX.create("input",{attrs:{type:"hidden",name:BX.util.htmlspecialchars(e),value:BX.util.htmlspecialchars(t[e])}}))}}else{var i=BX.create("div",{props:{id:this.name+"_formParams"}});for(e in t){i.appendChild(BX.create("input",{props:{type:"hidden",name:BX.util.htmlspecialchars(e),value:BX.util.htmlspecialchars(t[e])}}))}this.form.appendChild(i)}};BX.adminTabControl.prototype.setPublicMode=function(t){this.bPublicMode=!!t;if(this.bPublicMode){var e=BX.WindowManager.Get();if(e){var i=this.name;BX.addCustomEvent(e,"onWindowClose",(function(){window[i]=null}))}}};BX.adminTabControl.prototype.ToggleFix=function(t,e){if(!this.bInited){this.bFixed[t]=typeof e=="undefined"?!this.bFixed[t]:!!e;return}if(typeof e!="undefined"){this.bFixed[t]=!e}switch(t){case"bottom":var i=BX(this.name+"_buttons_div");if(!!i){if(this.bFixed[t]){BX.addClass(i,"adm-detail-content-btns-pin");i.firstChild.firstChild.title=BX.message("JSADM_PIN_ON");BX.UnFix(i)}else{BX.removeClass(i,"adm-detail-content-btns-pin");i.firstChild.firstChild.title=BX.message("JSADM_PIN_OFF");BX.Fix(i,{type:"bottom",limit_node:i.parentNode})}}break;case"top":if(!!this.TABS_BLOCK){if(this.bFixed[t]){BX.addClass(this.TABS_BLOCK,"adm-detail-tabs-block-pin");this.TABS_BLOCK.lastChild.title=BX.message("JSADM_PIN_ON");BX.UnFix(this.TABS_BLOCK)}else{BX.removeClass(this.TABS_BLOCK,"adm-detail-tabs-block-pin");this.TABS_BLOCK.lastChild.title=BX.message("JSADM_PIN_OFF");BX.Fix(this.TABS_BLOCK,{type:"top",limit_node:this.TABS_BLOCK.parentNode})}}break}this.bFixed[t]=!this.bFixed[t];BX.userOptions.save("edit","admin_tabs","fix_"+t,this.bFixed[t]?"on":"off")};BX.adminTabControl.prototype.SelectTab=function(t){if(!this.bInited){setTimeout("window."+this.name+".SelectTab('"+BX.util.jsencode(t)+"')",50)}else if(!this.aTabsDisabled[t]){var e=BX(t);if(e.style.display!="none"){if(this.bExpandTabs){var i=BX.pos(e),s=BX.GetWindowScrollPos();if(!!this.TABS_BLOCK&&this.bFixed["top"]){i.top-=this.TABS_BLOCK.offsetHeight}window.scrollTo(s.scrollLeft,i.top)}}else{var a=0;var n=0;var o=40;for(var r=0,l=this.aTabs.length;r<l;r++){var d=BX(this.aTabs[r]["DIV"]);if(d.style.display!="none"){a=this.aTabs[r].CONTENT_BLOCK.offsetHeight-o;this.ShowTab(this.aTabs[r]["DIV"],false);d.style.display="none";break}}this.ShowTab(t,true);e.style.display="block";BX(this.name+"_active_tab").value=t;var h=null;for(r=0,l=this.aTabs.length;r<l;r++){if(this.aTabs[r]["DIV"]==t){this.aTabs[r]["_ACTIVE"]=true;if(this.aTabs[r]["ONSELECT"]){BX.evalGlobal(this.aTabs[r]["ONSELECT"])}if(!this.bPublicMode){h=this.aTabs[r];var c=this.aTabs[r].CONTENT_BLOCK;n=c.offsetHeight-o;if(a>0){c.style.height=a+"px";c.style.overflowY="hidden";this.aTabs[r].EDIT_TABLE.style.opacity=0}}break}}if(!!this.TABS_BLOCK){if(BX.hasClass(this.TABS_BLOCK,"adm-detail-tabs-block-fixed")){i=BX.pos(e);s=BX.GetWindowScrollPos();window.scrollTo(s.scrollLeft,i.top-this.TABS_BLOCK.offsetHeight-parseInt(this.TABS_BLOCK.style.top))}}if(!this.bPublicMode&&a>0&&n>0&&h){var f=new BX.easing({duration:500,start:{height:a,opacity:0},finish:{height:n,opacity:100},transition:BX.easing.makeEaseOut(BX.easing.transitions.quart),step:BX.proxy((function(t){this.CONTENT_BLOCK.style.height=t.height+"px";this.EDIT_TABLE.style.opacity=t.opacity/100;BX.onCustomEvent("onAdminTabsChange")}),h),complete:BX.proxy((function(){this.CONTENT_BLOCK.style.height="auto";this.CONTENT_BLOCK.style.overflowY="visible";BX.onCustomEvent("onAdminTabsChange")}),h)});f.animate()}else{BX.onCustomEvent("onAdminTabsChange")}}}};BX.adminTabControl.prototype.ShowTab=function(t,e){if(e)BX.addClass(BX("tab_cont_"+t),"adm-detail-tab-active");else BX.removeClass(BX("tab_cont_"+t),"adm-detail-tab-active")};BX.adminTabControl.prototype.ShowDisabledTab=function(t,e){var i=BX("tab_cont_"+t);if(e){BX.addClass(i,"adm-detail-tab-disable")}else{BX.removeClass(i,"adm-detail-tab-disable")}};BX.adminTabControl.prototype.NextTab=function(){var t=BX(this.name+"_active_tab").value;var e="";for(var i=0;i<this.aTabs.length;i++){if(t==this.aTabs[i]["DIV"]){if(i>=this.aTabs.length-1)e=this.aTabs[0];else e=this.aTabs[i+1]}}if(e["DIV"])this.SelectTab(e["DIV"])};BX.adminTabControl.prototype.ToggleTabs=function(){this.bExpandTabs=!this.bExpandTabs;var t=BX(this.name+"_expand_link");t.title=this.bExpandTabs?BX.message("JSADM_TABS_COLLAPSE"):BX.message("JSADM_TABS_EXPAND");if(this.bExpandTabs){BX.addClass(t,"adm-detail-title-setting-active")}else{BX.removeClass(t,"adm-detail-title-setting-active")}for(var e=0;e<this.aTabs.length;e++){var i=this.aTabs[e]["DIV"];var s=BX(i);this.ShowTab(i,false);s.style.display=this.bExpandTabs&&!this.aTabsDisabled[i]?"block":"none"}if(!this.bExpandTabs){this.ShowTab(this.aTabs[0]["DIV"],true);s=document.getElementById(this.aTabs[0]["DIV"]);s.style.display="block"}BX.userOptions.save("edit",this.unique_name,"expand",this.bExpandTabs?"on":"off");BX.onCustomEvent("OnToggleTabs");BX.onCustomEvent("onAdminTabsChange")};BX.adminTabControl.prototype.DisableTab=function(t){this.aTabsDisabled[t]=true;this.ShowDisabledTab(t,true);if(this.bExpandTabs){var e=BX(t);if(e&&e.style){e.style.display="none"}}};BX.adminTabControl.prototype.EnableTab=function(t){this.aTabsDisabled[t]=false;this.ShowDisabledTab(t,this.bExpandTabs);if(this.bExpandTabs){var e=BX(t);if(e&&e.style){e.style.display="block"}}};BX.adminTabControl.prototype.ShowWarnings=function(t,e){var i=document.forms[t];if(!i)return;for(var s in e){var a=i.elements[e[s]["name"]];if(!a)continue;var n=a.type?a.type.toLowerCase():"";var o=false;if(a.length>1&&n!="select-one"&&n!="select-multiple"){a=a[0];o=true}if(n=="textarea"||n=="select-multiple")o=true;var r=a.parentNode;var l;if(o){l=r.insertBefore(new Image,a);r.insertBefore(document.createElement("BR"),a)}else{l=r.insertBefore(new Image,a.nextSibling);l.hspace=2;l.vspace=2;l.style.verticalAlign="middle"}l.src="/bitrix/panel/main/images_old/icon_warn.gif";l.title=e[s]["title"]}};BX.adminTabControl.prototype.ShowSettings=function(t){new BX.CDialog({content_url:t,resizable:true,height:605,width:560}).Show()};BX.adminTabControl.prototype.CloseSettings=function(){BX.WindowManager.Get().Close()};BX.adminTabControl.prototype.SaveSettings=function(t){var e="",i="";var s;var a=BX("selected_tabs");if(a){var n=a.length;for(var o=0;o<n;o++){i=a[o].value+"--#--"+a[o].text;s=BX("selected_fields["+a[o].value+"]");if(s){var r=s.length;for(var l=0;l<r;l++){i+="--,--"+s[l].value+"--#--"+jsUtils.trim(s[l].text)}}e+=i+"--;--"}}var d=document.form_settings.set_default&&document.form_settings.set_default.checked;var h="";h+="&p[0][c]=form";h+="&p[0][n]="+BX.util.urlencode(this.name);if(d)h+="&p[0][d]=Y";h+="&p[0][v][tabs]="+BX.util.urlencode(e);var c="/bitrix/admin/user_options.php?lang="+BX.message("LANGUAGE_ID")+"&sessid="+BX.bitrix_sessid();c+="&action=delete&c=form&n="+this.name+"_disabled";BX.WindowManager.Get().showWait(t);BX.ajax.post(c,h,BX.proxy((function(){BX.WindowManager.Get().closeWait(t);BX.WindowManager.Get().Close();location.reload()}),this))};BX.adminTabControl.prototype.DeleteSettings=function(t){BX.showWait();BX.userOptions.del("form",this.name,t,(function(){location.reload()}))};BX.adminTabControl.prototype.DisableSettings=function(){var t=new JCHttpRequest;t.Action=function(){location.reload()};var e="";e+="&p[0][c]=form";e+="&p[0][n]="+encodeURIComponent(this.name+"_disabled");e+="&p[0][v][disabled]=Y";t.Send("/bitrix/admin/user_options.php?lang="+phpVars.LANGUAGE_ID+e+"&sessid="+phpVars.bitrix_sessid)};BX.adminTabControl.prototype.EnableSettings=function(){var t=new JCHttpRequest;t.Action=function(){location.reload()};var e="";e+="&c=form";e+="&n="+encodeURIComponent(this.name)+"_disabled";e+="&action=delete";t.Send("/bitrix/admin/user_options.php?lang="+phpVars.LANGUAGE_ID+e+"&sessid="+phpVars.bitrix_sessid)};BX.adminViewTabControl=function(t){this.aTabs=t;this.bPublicMode=false;BX.ready(BX.delegate(this.Init,this))};BX.adminViewTabControl.prototype.setPublicMode=function(t){this.bPublicMode=!!t};BX.adminViewTabControl.prototype.SelectTab=function(t){var e=BX(t);if(e.style.display!="none")return;var i=0;var s=41;for(var a in this.aTabs){var n=BX(this.aTabs[a]["DIV"]);if(n.style.display!="none"){var o=BX("view_tab_"+this.aTabs[a]["DIV"]);BX.removeClass(o,"adm-detail-subtab-active");var r=BX.findChild(n,{className:"adm-detail-content-item-block-view-tab"});if(r)i=r.offsetHeight-s;n.style.display="none";break}}var l=BX("view_tab_"+t);BX.addClass(l,"adm-detail-subtab-active");e.style.display="block";var d=0;var h=BX.findChild(e,{className:"adm-detail-content-item-block-view-tab"});var c=null;if(h){d=h.offsetHeight-s;if(i>0){h.style.height=i+"px";h.style.overflowY="hidden";c=BX.findChild(h,{tagName:"table"});if(c)c.style.opacity=0}}for(a in this.aTabs){if(this.aTabs[a]["DIV"]==t){if(this.aTabs[a]["ONSELECT"]){BX.evalGlobal(this.aTabs[a]["ONSELECT"])}break}}if(i>0&&d>0&&h){var f=new BX.easing({duration:500,start:{height:i,opacity:0},finish:{height:d,opacity:100},transition:BX.easing.makeEaseOut(BX.easing.transitions.quart),step:BX.proxy((function(t){this.style.height=t.height+"px";if(c)c.style.opacity=t.opacity/100;BX.onCustomEvent("onAdminTabsChange")}),h),complete:BX.proxy((function(){this.style.height="auto";this.style.overflowY="visible";BX.onCustomEvent("onAdminTabsChange")}),h)});f.animate()}else BX.onCustomEvent("onAdminTabsChange")};BX.adminViewTabControl.prototype.DisableTab=function(t){if(this.aTabs.length<=0){return}var e=null;var i=false;for(var s in this.aTabs){if(this.aTabs[s]["DIV"]==t){if(s>0){e=parseInt(s)-1;while(e>=0){if(BX("view_tab_"+this.aTabs[e]["DIV"]).style.display!="none"){this.SelectTab(this.aTabs[e]["DIV"]);i=true;break}e--}}if(!i){e=parseInt(s)+1;while(e<this.aTabs.length-1){if(BX("view_tab_"+this.aTabs[e]["DIV"]).style.display!="none"){this.SelectTab(this.aTabs[e]["DIV"]);i=true;break}e++}}if(!i){BX(t).style.display="none"}BX("view_tab_"+this.aTabs[s]["DIV"]).style.display="none";break}}};BX.adminViewTabControl.prototype.EnableTab=function(t){for(var e in this.aTabs){if(this.aTabs[e]["DIV"]==t){BX("view_tab_"+this.aTabs[e]["DIV"]).style.display="inline-block";this.SelectTab(this.aTabs[e]["DIV"]);break}}};BX.adminViewTabControl.prototype.ReplaceAnchor=function(t){};BX.adminViewTabControl.prototype.RebuildTabs=function(){};BX.adminViewTabControl.prototype.Init=function(){if(this.aTabs.length==0)return};BX.adminHistory=function(){BX.bind(window,"popstate",BX.proxy(this._get,this));this.bStart=true;this.pushSupported=true;this.state={};this.startState=null;this.disabled=false};BX.adminHistory.pushSupported=false;BX.adminHistory.disable=BX.adminHistory.prototype.disable=function(){BX.adminHistory.disabled=true};BX.adminHistory.enable=BX.adminHistory.prototype.enable=function(){BX.adminHistory.disabled=false};BX.adminHistory.put=function(t,e,i){if(BX.adminHistory.disabled)return;var s=BX("navchain-link");if(s){if(t.indexOf("&amp;")>0)t=BX.util.htmlspecialcharsback(t);if(BX.type.isArray(i))t=BX.util.remove_url_param(t,i);s.href=t;if(t!=window.location.href)BX.addClass(s,"navchain-link-visible");else BX.removeClass(s,"navchain-link-visible")}};BX.adminHistory.prototype.put=function(t,e,i){if(BX.adminHistory.disabled)return;if(t.indexOf("&amp;")>0)t=BX.util.htmlspecialcharsback(t);if(BX.type.isArray(i))t=BX.util.remove_url_param(t,i);t=BX.util.remove_url_param(t,"admin_history");var s={url:t,callback:e};var a=Math.random();this.state[a]=s;if(this.bStart){this.startState=a;this.bStart=false}else{history.pushState(a,"",t)}};BX.adminHistory.prototype._get=function(t){t=t||window.event||{state:null};var e=t.state;if(e===null){e=this.startState}if(e&&this.state[e]){if(this.state[e].callback){this.state[e].callback(this.state[e].url+(this.state[e].url.indexOf("?")>0?"&":"?")+"admin_history=Y")}else{window.location.href=this.state[e].url}}};BX.FixOffsets={top:0,bottom:0,right:0};BX.Fix=function(t,e){if(!t.BXFIXER){if(t.tagName.toUpperCase()=="THEAD")t.BXFIXER=new BX.CFixerTHead(t,e);else t.BXFIXER=new BX.CFixer(t,e)}t.BXFIXER.Start()};BX.UnFix=function(t){if(!!t&&!!t.BXFIXER)t.BXFIXER.Stop()};BX.CFixer=function(t,e){this.node=t;this.params=e||{type:"top"};this.pos={};this.limit=-1;this.position_top=null;this.position_bottom=null;this.position_right=null;this.bStarted=false;this.bFixed=false;this.gutter=null;this.clingTop=null;this.clingBottom=null;this.clingRight=null};BX.CFixer.prototype.Start=function(){if(this.bStarted)return;this.pos=BX.pos(this.node);BX.bind(window,"scroll",BX.proxy(this._scroll_listener,this));BX.bind(window,"resize",BX.proxy(this._scroll_listener,this));BX.bind(window,"resize",BX.proxy(this._recalc_pos,this));BX.addCustomEvent("onAdminFilterToggleRow",BX.proxy(this._recalc_pos,this));BX.addCustomEvent("onAdminFilterToggleRow",BX.proxy(this._scroll_listener,this));BX.addCustomEvent("onAdminPanelFix",BX.defer(this._scroll_listener,this));BX.addCustomEvent("onAdminPanelChange",BX.defer(this._scroll_listener,this));BX.addCustomEvent("onAdminTabsChange",BX.defer(this._recalc_pos,this));BX.addCustomEvent(BX.adminMenu,"onAdminMenuResize",BX.proxy(this._recalc_pos,this));this._scroll_listener();this.bStarted=true};BX.CFixer.prototype.Stop=function(){if(!this.bStarted)return;this._UnFix();BX.unbind(window,"scroll",BX.proxy(this._scroll_listener,this));BX.unbind(window,"resize",BX.proxy(this._scroll_listener,this));BX.unbind(window,"resize",BX.proxy(this._recalc_pos,this));BX.removeCustomEvent("onAdminFilterToggleRow",BX.proxy(this._recalc_pos,this));BX.removeCustomEvent("onAdminFilterToggleRow",BX.proxy(this._scroll_listener,this));BX.removeCustomEvent("onAdminPanelFix",BX.defer(this._scroll_listener,this));BX.removeCustomEvent("onAdminTabsChange",BX.defer(this._recalc_pos,this));BX.removeCustomEvent("onAdminPanelChange",BX.defer(this._scroll_listener,this));BX.removeCustomEvent(BX.adminMenu,"onAdminMenuResize",BX.proxy(this._recalc_pos,this));this.bStarted=false};BX.CFixer.prototype._recalc_pos=function(){this.pos=BX.pos(this.gutter||this.node);var t=BX.pos(this.node);if(this.bFixed){if(this.params.type=="top"||this.params.type=="bottom"){this.node.style.width=this.pos.width+"px";this.gutter.style.height=t.height+"px"}}this._scroll_listener()};BX.CFixer.prototype._Fix=function(){if(!this.bFixed){this.pos=BX.pos(this.gutter||this.node);if(!this.gutter)this.gutter=this.node.parentNode.insertBefore(BX.create(this.node.tagName,{style:{display:"block",height:this.pos.height+"px"},props:{className:this.node.className}}),this.node);this._w=this.node.style.width;this.node.style.width=this.pos.width+"px";BX.addClass(this.node,"bx-fixed-"+this.params.type);if(this["position_"+this.params.type]!==null)this.node.style[this.params.type]=this["position_"+this.params.type]+"px";this.bFixed=true;if(this.params.type=="top"){this.clingTop=BX.FixOffsets.top;BX.FixOffsets.top+=this.pos.height}BX.addCustomEvent("onAdminFixerUnfix",BX.proxy(this._cling_offset_correction,this))}};BX.CFixer.prototype._UnFix=function(t){if(this.bFixed){this.node.style.width=this._w;BX.removeClass(this.node,"bx-fixed-"+this.params.type);this.node.style[this.params.type]=null;this.bFixed=false;if(!t){if(this.gutter&&this.gutter.parentNode)this.gutter.parentNode.removeChild(this.gutter);this.gutter=null;this._check_scroll(this.pos.left,this.pos.top)}var e,i;if(this.params.type=="top"){e=this.clingTop;i=this.pos.height;this.clingTop=null;BX.FixOffsets.top-=this.pos.height}BX.removeCustomEvent("onAdminFixerUnfix",BX.proxy(this._cling_offset_correction,this));BX.onCustomEvent("onAdminFixerUnfix",[{type:this.params.type,clingPoint:e,offsetSize:i}])}};BX.CFixer.prototype._ReFix=function(){if(this.bFixed){this._UnFix(true);BX.defer(this._Fix,this)()}};BX.CFixer.prototype._cling_offset_correction=function(t){if(this.params.type==t.type){if(this.params.type=="top"&&t.clingPoint<this.clingTop)this.clingTop-=t.offsetSize;this._scroll_listener()}};BX.CFixer.prototype._scroll_listener=function(){var t=BX.GetWindowScrollPos(),e=this.bFixed,i;if(!BX.isNodeInDom(this.node))return this.Stop();var s=e?this.pos:BX.pos(this.node);if(this.params.limit_node){var a=BX.pos(this.params.limit_node);switch(this.params.type){case"top":this.limit=a.bottom-this.pos.height;break;case"bottom":this.limit=a.top+this.pos.height;break;case"right":this.limit=a.right+this.node.offsetWidth;break}}if(!BX.isNodeHidden(this.node)){switch(this.params.type){case"top":var n=this.clingTop!==null?this.clingTop:BX.FixOffsets.top;this.position_top=BX.adminPanel.isFixed()?BX.adminPanel.panel.offsetHeight+n:n;if(this.limit>n&&t.scrollTop+this.position_top>this.limit)this._UnFix();else if(!this.bFixed&&t.scrollTop+this.position_top>=s.top)this._Fix();else if(this.bFixed&&t.scrollTop+this.position_top<s.top)this._UnFix();break;case"bottom":i=BX.GetWindowInnerSize();t.scrollBottom=t.scrollTop+i.innerHeight;if(this.limit>0&&t.scrollBottom<this.limit)this._UnFix();else if(!this.bFixed&&t.scrollBottom<s.bottom)this._Fix();else if(this.bFixed&&t.scrollBottom>=s.bottom)this._UnFix();break;case"right":i=BX.GetWindowInnerSize();t.scrollRight=t.scrollLeft+i.innerWidth-15;if(this.limit>0&&t.scrollRight<this.limit)this._UnFix();else if(!this.bFixed&&t.scrollRight<s.right)this._Fix();else if(this.bFixed&&t.scrollRight>=s.right)this._UnFix();break}}else if(this.bFixed){this._UnFix()}if(this.bFixed){this._check_scroll(t.scrollLeft,t.scrollTop)}else{this._check_scroll(this.pos.left,this.pos.top)}if(e!=this.bFixed){BX.onCustomEvent(this.node,"onFixedNodeChangeState",[this.bFixed])}};BX.CFixer.prototype._check_scroll=function(t,e){if(this.params.type=="top"||this.params.type=="bottom")this.node.style.left=this.pos.left-t+"px";else this.node.style.top=this.pos.top-e+"px";if(this.bFixed&&this["position_"+this.params.type]!==null){this.node.style[this.params.type]=this["position_"+this.params.type]+"px"}};BX.CFixerTHead=function(){BX.CFixerTHead.superclass.constructor.apply(this,arguments);this.mirror=null;this.mirror_thead=null};BX.extend(BX.CFixerTHead,BX.CFixer);BX.CFixerTHead.prototype._Fix=function(){if(!this.bFixed){if(!this.mirror){this.pos=BX.pos(this.node);var t=BX.GetWindowScrollPos();this.mirror_thead=BX.clone(this.node);this.mirror=document.body.appendChild(BX.create("DIV",{style:{left:this.pos.left-t.scrollLeft+"px"},props:{className:"bx-fixed-"+this.params.type+" adm-list-table-fixed"},children:[BX.create("TABLE",{props:{className:this.node.parentNode.className},style:{width:this.node.parentNode.offsetWidth+"px"},children:[this.mirror_thead]})]}));for(var e=0;e<this.node.rows[0].cells.length;e++){this.mirror_thead.rows[0].cells[e].appendChild(BX.create("SPAN",{style:{cssFloat:"left",height:"1px"},html:'<img src="/bitrix/images/1.gif" style="height: 0; width: '+(this.node.rows[0].cells[e].offsetWidth-4)+'px;">'}));this.mirror_thead.rows[0].cells[e].style.width=this.node.rows[0].cells[e].offsetWidth+"px"}}this.mirror.style.display="block";this.mirror.style.top=(this.position_top!==null?this.position_top:0)+"px";this.bFixed=true}};BX.CFixerTHead.prototype._UnFix=function(){if(this.bFixed){if(!!this.mirror){this._clear_mirror()}this.bFixed=false}};BX.CFixerTHead.prototype._recalc_pos=function(){this.pos=BX.pos(this.node);if(this.bFixed&&(this.params.type=="top"||this.params.type=="bottom")){this.mirror.firstChild.style.width=this.pos.width+"px"}this._scroll_listener()};BX.CFixerTHead.prototype._clear_mirror=function(){if(!!this.mirror)this.mirror.parentNode.removeChild(this.mirror);this.mirror=null;this.mirror_thead=null};BX.CFixerTHead.prototype._check_scroll=function(t){if(!!this.mirror){this.mirror.style.left=this.pos.left-t+"px";if(this.bFixed&&this["position_"+this.params.type]!==null)this.mirror.style[this.params.type]=this["position_"+this.params.type]+"px"}};BX.adminShowMenu=function(t,e,i){if(t.OPENER)return true;var s=t,a=null;if(typeof t=="object"&&!BX.type.isElementNode(t)&&typeof t.x!="undefined"){a=document.body.appendChild(BX.create("DIV",{style:{position:"absolute",left:t.x+"px",top:t.y+"px",height:0,width:0}}));s=a}i=i||{};s.OPENER=new BX.COpener({DIV:s,MENU:e,TYPE:"click",ACTIVE_CLASS:typeof i.active_class!="undefined"?i.active_class:"adm-btn-active",PUBLIC_FRAME:typeof i.public_frame!="undefined"?parseInt(i.public_frame):0,CLOSE_ON_CLICK:typeof i.close_on_click!="undefined"?!!i.close_on_click:true});var n=function(){BX.onCustomEvent(t,"onAdminMenuClose");if(!!a){a.parentNode.removeChild(a);a=null}s=null};BX.addCustomEvent(s.OPENER,"onOpenerMenuClose",n);BX.addCustomEvent(s.OPENER,"onOpenerMenuOpen",(function(){BX.onCustomEvent(t,"onAdminMenuShow")}));s.OPENER.Toggle()};BX.AdminFilter=function(t,e){var i=this;this.filter_id=t;this.aRows=e;this.oVisRows={};this.oOptions={};this.curID="0";this.form=jsUtils.FindParentObject(BX(this.filter_id),"form");this.popupItems={};this.missingRows=0;this.tableWrap=null;this.table=null;this.easing=null;this.startContentHeight=0;this.table_id=false;this.url=false;this.currentLoadedTab=null;this.presetsDeleted=[];this.state={init:false,requesting:false,clearing:false,folded:false,saving:false};this.params={filteredId:false,activeTabId:false};this.SetFoldedView=function(){BX.toggleClass(BX("adm-filter-tab-wrap-"+this.filter_id),"adm-filter-folded");this.state.folded=!this.state.folded;BX.userOptions.save("filter",this.filter_id,"styleFolded",this.state.folded?"Y":"N");this.SetSwitcherTitle()};this.SetSwitcherTitle=function(){var t=BX("adm-filter-switcher-tab");var e=BX("adm-filter-tab-wrap-"+this.filter_id);t.title=BX.hasClass(e,"adm-filter-folded")?BX.message("JSADM_FLT_UNFOLD"):BX.message("JSADM_FLT_FOLD")};this.InitFilter=function(t){var e=this.isObjectEmpty(t);this.SetSwitcherTitle();this.oVisRows=t;var i=BX(this.filter_id);if(!i)return;this.table=i;var s=i.rows.length;this.missingRows=i.rows.length-this.aRows.length;var a=this.missingRows;for(var n=s-1;n>=0;n--){var o=i.rows[n];var r=o.insertCell(-1);var l="";BX.admFltWrap.Row(o);if(n-a>=0){l=this.aRows[n-a]}else{l="miss-"+n;this.aRows.unshift(l);if(e)this.oVisRows[l]=true}o.id=this.filter_id+"_row_"+l;if(this.oVisRows[l]!=true)o.style.display="none";r.innerHTML='<span class="adm-filter-item-delete" onclick="this.blur(); '+this.filter_id+".DeleteFilterRow('"+o.id+'\');" hidefocus="true" title="'+phpVars.messFilterLess+'" style="display: none;"></span>'}for(n=0;n<s;n++){var d=i.insertRow(n*2+1);if(this.oVisRows[this.aRows[n]]!=true)d.style.display="none";d.id=this.filter_id+"_row_"+this.aRows[n]+"_delim";r=d.insertCell(-1);r.colSpan=3;r.className="delimiter";r.innerHTML='<div class="empty"></div>'}try{i.style.display="table"}catch(t){i.style.display="block"}this.tableWrap=i.parentNode;this.DisplayNonEmptyRows();this.ChangeViewDependVisible();BX.addCustomEvent(window,"onAdminListLoaded",BX.proxy(this.onAdminListLoaded,this));BX.onCustomEvent(window,"onAdminFilterInited",[{filterId:this.filter_id}])};this.InitFirst=function(){this.oOptions["0"]={FIELDS:{},EDITABLE:false};for(var t in this.oOptions)this.oOptions[t]["tab"]=new BX.admFltTab(t,this)};this.InitFilteredTab=function(t){var e=false;if(this.oOptions[t])e=t;else e=this.GetByPresetId(t);if(e===false)return false;if(!this.ApplyFilter(e))return false;if(this.state.folded){this.oOptions["0"]["tab"].UnSetActive();this.oOptions[e]["tab"].SetActive()}this.oOptions[e]["tab"].SetFiltered(true);return true};this.InitOpenedTab=function(t,e){var i=[t,e];var s,a;for(var n in i){var o=i[n];if(o=="")continue;a=false;if(this.oOptions[o])a=o;else a=this.GetByPresetId(o);if(a===false)continue;s=BX("adm-filter-tab-"+this.filter_id+"-"+a);if(s)break}if(!s)return false;this.SetActiveTab(s);this.ApplyFilter(a);if(a==t)this.SaveFilterParams();return true};this.GetByPresetId=function(t){for(var e in this.oOptions)if(this.oOptions[e]&&this.oOptions[e]["PRESET_ID"]&&this.oOptions[e]["PRESET_ID"]==t)return e;return false};this.isObjectEmpty=function(t){for(var e in t)return false;return true};this.ChangeViewDependVisible=function(){var t=this.CountVisibleRows();if(t<1)this.ToggleFilterRow(this.filter_id+"_row_"+this.aRows[0],true);if(t<=1)this.ToggleButtonsHideAll();if(t>=2)this.ToggleButtonsShowAll();this.SetBottomStyle()};this.UrlAddParams=function(t,e){var i=t;var s=t.substr(t.length-1);if(i.indexOf("?")>=0){if(s!="&")i+="&"}else{i+="?"}i+=e;return i};this.OnSet=function(t,e,s){if(!window[t]){return true}if(this.state.requesting){return false}if(!this.table_id){this.table_id=t}if(!this.url){this.url=e}BX.onCustomEvent(window,"onBeforeAdminFilterSet");if(this.curID!="0"&&!this.state.init){this.Save()}var a=this.UrlAddParams(e,"set_filter=Y&adm_filter_applied="+encodeURIComponent(this.curID));if(this.oOptions[this.curID]["PRESET_ID"]){a+=this.UrlAddParams(a,"adm_filter_preset="+encodeURIComponent(this.oOptions[this.curID]["PRESET_ID"]))}var n=this.GetParameters();this.state.requesting=true;BX.defer((function(){if(i.state.folded){i.currentLoadedTab=i.oOptions[i.curID]["tab"].GetObj();i.oOptions[i.curID]["tab"].ShowWheel()}else{BX.adminPanel.showWait(s)}var e={func:function(){if(!i.state.saving){window[t].GetAdminList(a+n);i.oOptions[i.curID]["tab"].SetFiltered(i.state.init);clearInterval(o)}}};var o=window.setInterval((function(){e.func.call(e)}),200)}))();return false};this.OnClear=function(t,e,s){if(!window[t]){return true}if(this.state.requesting){return false}this.state.clearing=true;BX.onCustomEvent(window,"onBeforeAdminFilterClear");var a=this.UrlAddParams(e,"del_filter=Y"+this.GetParameters());this.state.requesting=true;BX.defer((function(){if(i.state.folded){i.currentLoadedTab=i.oOptions[i.curID]["tab"].GetObj();i.oOptions[i.curID]["tab"].ShowWheel()}else{BX.adminPanel.showWait(s)}if(i.params.filteredId&&i.oOptions[i.params.filteredId]&&!i.state.folded){i.oOptions[i.params.filteredId]["tab"].UnSetFiltered()}window[t].GetAdminList(a)}))();return false};this.onAdminListLoaded=function(){if(this.currentLoadedTab===false)return;BX.removeClass(this.currentLoadedTab,"adm-filter-tab-loading");if(this.state.clearing&&this.params.filteredId!==false&&this.oOptions[this.params.filteredId])this.oOptions[this.params.filteredId]["tab"].UnSetFiltered();this.currentLoadedTab=null;this.state.clearing=false;this.state.requesting=false};this.GetFormButton=function(t){if(!t)return false;var e=BX(this.filter_id+t);if(e)return e;return this.form[t]};this.ApplyFilter=function(t){if(this.state.requesting&&!this.state.init)return false;if(!this.oOptions[t])return false;if(this.curID=="0")this.oOptions["0"]["FIELDS"]=this.GetFilterFields(true);this.curID=t;this.StartAnimation();this.SetFilterFields(this.oOptions[t]["FIELDS"]);if(!this.state.init){this.SaveFilterParams()}this.EndAnimation();if(this.state.folded&&!this.state.init){this.currentLoadedTab=this.oOptions[t]["tab"].GetObj();this.oOptions[t]["tab"].ShowWheel();if(this.params.filteredId===t){var e=this.GetFormButton("del_filter");if(this.filter_id&&this.url){this.OnClear(this.table_id,this.url,e)}else{if(e)e.onclick()}}else{var i=this.GetFormButton("set_filter");if(this.filter_id&&this.url){this.OnSet(this.table_id,this.url,i)}else{if(i)i.onclick();else this.form.submit()}}}return true};this.Save=function(t){var e=this.GetFilterFields(true);if(!this.oOptions[this.curID]["EDITABLE"]&&!t){this.SaveInsteadPreset();return}if(t||this.curID=="0")this.ShowSaveOptsWnd(e,false);else{var i=this.oOptions[this.curID]["COMMON"]=="Y";this.SaveToBase(this.oOptions[this.curID]["NAME"],i,e,false,false)}};this.SaveAs=function(){this.Save(true)};this.Delete=function(){if(!this.oOptions[this.curID].EDITABLE)this.MarkPresetAsDeleted(this.curID);else this.DeleteFromBase(this.curID)};this.GetClearFields=function(){var t=this.GetFilterFields();for(var e in t)t[e]["value"]="";return t};this.ReplaceFilterTab=function(t,e){if(!t||!e)return false;var s=BX("adm-filter-tab-"+this.filter_id+"-"+t);if(!s)return false;s.id="adm-filter-tab-"+this.filter_id+"-"+e;if(this.url&&BX.adminMenu&&BX.adminMenu.registerItem){var a=BX.util.remove_url_param(this.url,["adm_filter_applied","adm_filter_preset"]);a+="&adm_filter_applied"+"="+BX.util.urlencode(e);BX.adminMenu.registerItem(s.id,{URL:a})}s.onclick=function(){i.SetActiveTab(this);i.ApplyFilter(e)};this.MarkPresetAsDeleted(t,e);return true};this.SetFilteredBG=function(t){if(!this.params.filteredId&&t!==false)return;if(t==this.params.filteredId&&t!==false)BX.addClass(BX("adm-filter-tab-wrap-"+this.filter_id),"adm-current-filter");else{BX.removeClass(BX("adm-filter-tab-wrap-"+this.filter_id),"adm-current-filter")}};this.SetActiveTab=function(t){if(this.state.requesting&&!this.state.init)return false;var e="adm-filter-tab-"+this.filter_id+"-";var i=t.id.substr(e.length,t.id.length);if(this.params.filteredId!==false&&this.params.filteredId===i&&this.state.folded)return true;var s=BX.findChildren(t.parentNode,{tag:"span"},false);for(var a=s.length-1;a>=0;a--)BX.removeClass(s[a],"adm-filter-tab-active");this.SetFilteredBG(i);this.oOptions[i]["tab"].SetActive();this.params.activeTabId=i;return true};this.ShowSaveOptsWnd=function(t,e){var s=false;if(!window["filterSaveOptsDialog"+this.filter_id]){window["filterSaveOptsDialog"+this.filter_id]=new BX.CDialog({content:'<form name="flt_save_opts_'+this.filter_id+'" onkeypress=" return '+this.filter_id+'.SaveOptsWndKeyPress(event);"></form>',title:BX.message("JSADM_FLT_SAVE_TITLE"),width:450,height:100,resizable:false});s=true}var a=document["flt_save_opts_"+this.filter_id];a.onKeyPress=this.onKeyPress;var n=BX("filter_save_opts_"+this.filter_id).children[0];window["filterSaveOptsDialog"+this.filter_id].ClearButtons();window["filterSaveOptsDialog"+this.filter_id].SetButtons([{id:this.filter_id+"_btn_save",className:"adm-btn-save",title:BX.message("JSADM_FLT_SAVE"),action:function(){var s;if(a.common)s=a.common.checked;else s=false;i.SaveToBase(a.save_filter_name.value,s,t,true,e);if(i.state.folded)i.SetFoldedView();this.parentWindow.Close()}},BX.CDialog.prototype.btnCancel]);window["filterSaveOptsDialog"+this.filter_id].adjustSizeEx();window["filterSaveOptsDialog"+this.filter_id].Show();if(s)a.appendChild(n);if(this.curID!="0"&&!e){a.save_filter_name.value=this.oOptions[this.curID]["NAME"]?this.oOptions[this.curID]["NAME"]:"";if(a.common)a.common.checked=this.oOptions[this.curID]["COMMON"]=="Y"}else{a.save_filter_name.value=BX.message("JSADM_FLT_NEW_NAME");if(a.common)a.common.checked=false}a.save_filter_name.focus()};this.SaveOptsWndKeyPress=function(t){if(!t)t=window.event;if(!t)return true;if(t.keyCode==13){BX(this.filter_id+"_btn_save").click();return false}if(t.keyCode==27){window["filterSaveOptsDialog"+this.filter_id].Close();return false}return true};this.MarkPresetAsDeleted=function(t,e){if(!e&&!confirm(BX.message("JSADM_FLT_DEL_CONFIRM")))return;this.presetsDeleted[this.presetsDeleted.length]=t;var i="";for(var s in this.presetsDeleted)i+=(i!=""?",":"")+this.presetsDeleted[s];var a=false;if(this.params.filteredId==this.curID)a=true;var n="0";if(e){this.oOptions[this.curID]["tab"].id=this.curID=n=e}else{this.oOptions[t]["tab"].DeleteHtml();delete this.oOptions[t]}var o=this.oOptions[n]["tab"].GetObj();if(o)o.click();BX.userOptions.save("filter",this.filter_id,"presetsDeleted",i);if(a&&this.table_id&&!e)this.OnClear(this.table_id,this.url)};this.DeleteFromBase=function(t){this.state.saving=true;if(!confirm(BX.message("JSADM_FLT_DEL_CONFIRM")))return;var e={id:t,action:"del_filter",sessid:phpVars.bitrix_sessid,lang:BX.message("LANGUAGE_ID")};var s=function(e){if(e){i.oOptions[t]["tab"].DeleteHtml();delete i.oOptions[t];var s=false;if(i.params.filteredId==i.curID)s=true;var a=i.oOptions["0"]["tab"].GetObj();if(a)a.click();i.state.saving=false;if(i.table_id&&s)i.OnClear(i.table_id,i.url)}else alert(BX.message("JSADM_FLT_DEL_ERROR"))};BX.ajax.post("/bitrix/admin/filter_act.php",e,s)};this.SaveInsteadPreset=function(){this.state.saving=true;var t={filter_id:this.filter_id,preset_id:this.curID,action:"save_filter",sessid:phpVars.bitrix_sessid,name:this.oOptions[this.curID]["NAME"],common:"N",fields:i.GetFilterFields(),lang:BX.message("LANGUAGE_ID")};if(this.oOptions[this.curID]["SORT_FIELD"])t["sort_field"]=this.oOptions[this.curID]["SORT_FIELD"];if(this.oOptions[this.curID]["SORT"])t["sort"]=this.oOptions[this.curID]["SORT"];var e=function(e){if(e){i.oOptions[e]={NAME:i.oOptions[i.curID]["NAME"],FIELDS:i.GetFilterFields(),EDITABLE:true,PRESET_ID:i.curID,COMMON:false};i.oOptions[e]["tab"]=new BX.admFltTab(e,i);if(t["sort_field"])i.oOptions[e]["SORT_FIELD"]=t["sort_field"];if(t["sort"])i.oOptions[e]["SORT"]=t["sort"];i.ReplaceFilterTab(i.curID,e);i.state.saving=false}else alert(BX.message("JSADM_FLT_SAVE_ERROR"))};BX.ajax.post("/bitrix/admin/filter_act.php",t,e)};this.SaveToBase=function(t,e,s,a,n){this.state.saving=true;if(t=="")t=BX.message("JSADM_FLT_NO_NAME");var o={filter_id:this.filter_id,action:"save_filter",sessid:phpVars.bitrix_sessid,name:t,common:e?"Y":"N",fields:s,lang:BX.message("LANGUAGE_ID")};if(!a&&this.curID!="0")o["id"]=this.curID;if(!a&&this.oOptions[this.curID]["PRESET_ID"])o["preset_id"]=this.oOptions[this.curID]["PRESET_ID"];if(this.oOptions[this.curID]["SORT_FIELD"])o["sort_field"]=this.oOptions[this.curID]["SORT_FIELD"];if(this.oOptions[this.curID]["SORT"])o["sort"]=this.oOptions[this.curID]["SORT"];var r=function(r){if(r){i.oOptions[r]={NAME:t,COMMON:e?"Y":"N",FIELDS:s,EDITABLE:true};if(o["sort_field"])i.oOptions[r]["SORT_FIELD"]=o["sort_field"];if(o["sort"])i.oOptions[r]["SORT"]=o["sort"];i.oOptions[r]["tab"]=new BX.admFltTab(r,i);if(a||o["id"]==undefined)i.oOptions[r]["tab"].AddHtml(i.url,t);if(n)i.ClearParameters();i.state.saving=false}else alert(BX.message("JSADM_FLT_SAVE_ERROR"))};BX.ajax.post("/bitrix/admin/filter_act.php",o,r);return o};this.ClearParameters=function(){if(!this.form)return;var t;var e=this.form.elements.length;for(t=0;t<e;t++){var i=this.form.elements[t];BX.removeClass(i,"adm-calendar-inp-setted");switch(i.type.toLowerCase()){case"text":case"textarea":i.value="";break;case"select-one":i.selectedIndex=0;if(i.onchange)i.onchange();break;case"select-multiple":var s;var a=i.options.length;for(s=0;s<a;s++)i.options[s].selected=false;break;default:break}}};this.GetRowByElement=function(t){return jsUtils.FindParentObject(t,"tr")};this.SetFilterFields=function(t){this.ClearParameters();var e=[];var i;for(var s=0,a=this.form.elements.length;s<a;s++){var n=this.form.elements[s];if(BX.hasClass(n,"adm-calendar-inp-setted"))continue;if(n.type=="select-multiple"){i=n.name.substr(0,n.name.length-2)}else if(n.type=="checkbox"&&n.name.search(/[\[\]]/)){i=n.name.substr(0,n.name.length-2);if(e[i]==undefined)e[i]=0;else e[i]++;i+="_cbxIdx_"+e[i];n.checked=false}else{i=n.name}if(!t[i]){var o=this.GetRowByElement(n);if(!o)continue;if(this.IsAllRowElementsHidden(o.id,t))this.ToggleFilterRow(o.id,false,false,true);continue}switch(n.type.toLowerCase()){case"select-one":n.value=t[i]["value"];if(n.value=="")n.selectedIndex=0;break;case"text":case"textarea":n.value=t[i]["value"];break;case"radio":case"checkbox":n.checked=n.value==t[i]["value"];break;case"select-multiple":var r=false;n.value=null;if(n.options.length>0){n.options[0].selected=false;for(var l=0,d=n.options.length;l<d;l++){for(var h in t[i]["value"]){if(n.options[l].value==t[i]["value"][h]){n.options[l].selected=true;r=true}}}if(!r&&n.options[0].value=="")n.options[0].selected=true}break;default:break}BX.fireEvent(n,"change");if(t[i]["hidden"]=="true"&&this.IsAllRowElementsHidden(this.GetRowByElement(n).id,t))this.ToggleFilterRow(this.GetRowByElement(n).id,false,false,true);else this.ToggleFilterRow(this.GetRowByElement(n).id,true,false)}if(this.CountVisibleRows()<1)this.ToggleFilterRow(this.filter_id+"_row_"+this.aRows[0],true,false)};this.IsFormElementHidden=function(t){if(BX.browser.IsOpera())return!t.offsetWidth&&!t.offsetHeight&&!t.clientHeight&&!t.clientWidth;return!t.offsetWidth&&!t.offsetHeight};this.IsAllRowElementsHidden=function(t,e){var i=true;for(var s=0,a=this.form.elements.length;s<a;s++){var n=this.form.elements[s];if(!e[n.name])continue;if(jsUtils.FindParentObject(n,"tr").id!=t)continue;if(e[n.name]["hidden"]=="false"){i=false;break}}return i};this.GetFilterFields=function(t){var e={};var i=[];var s;for(var a=0,n=this.form.elements.length;a<n;a++){var o=this.form.elements[a];if(!o.name)continue;if(o.type=="select-multiple"){s=o.name.substr(0,o.name.length-2)}else if(o.type=="checkbox"&&o.name.search(/[\[\]]/)){s=o.name.substr(0,o.name.length-2);if(i[s]==undefined)i[s]=0;else i[s]++;s+="_cbxIdx_"+i[s]}else{s=o.name}switch(o.type.toLowerCase()){case"select-one":case"text":case"textarea":e[s]={value:o.value};break;case"radio":if(o.checked)e[s]={value:o.value};break;case"checkbox":if(o.checked)e[s]={value:o.value};else e[s]={value:false};break;case"select-multiple":e[s]={value:[]};for(var r=0,l=o.options.length;r<l;r++)if(o.options[r].selected&&o.options[r].value)e[s]["value"]["sel_"+o.options[r].value]=o.options[r].value;break;default:break}if(!e[s])continue;if(t)e[s]["hidden"]=this.GetRowByElement(o).style.display=="none"?"true":"false";else e[s]["hidden"]=this.IsFormElementHidden(o)?"true":"false"}return e};this.IsFilterFill=function(){if(!this.form)return;var t;var e=this.form.elements.length;for(t=0;t<e;t++){var i=this.form.elements[t];if(i.disabled)continue;var s=this.GetRowByElement(i);if(s&&s.style&&s.style.display=="none")continue;switch(i.type.toLowerCase()){case"select-one":if(i.options.length>0)if(i.options[0].value.length!=0&&(i.options[0].value.toUpperCase()!="NOT_REF"||i.value.toUpperCase()=="NOT_REF"))break;case"text":case"textarea":if(i.value.length>0)return true;break;case"checkbox":if(i.checked)return true;break;case"select-multiple":var a;var n=i.options.length;for(a=0;a<n;a++)if(i.options[a].selected&&i.options[a].value!="")return true;break;default:break}}return false};this.GetParameters=function(){if(!this.form)return;var t,e="";var i=this.form.elements.length;for(t=0;t<i;t++){var s=this.form.elements[t];if(s.disabled)continue;var a=this.GetRowByElement(s);if(a&&a.style&&a.style.display=="none")continue;if(s.className=="adm-select adm-calendar-period"&&s.value!=""){var n=s.parentNode.parentNode;var o=BX.findChild(n,{className:"adm-input adm-calendar-from"},true);var r=BX.findChild(n,{className:"adm-input adm-calendar-to"},true);var l=false;var d=false;var h=new Date;var c=h.getFullYear();var f=h.getMonth();var m=h.getDate();var p=h.getDay();if(p==0)p=7;switch(s.value){case"exact":l=BX.parseDate(o.value,false,phpVars.FORMAT_DATE,phpVars.FORMAT_DATETIME);d=l;break;case"after":r.value="";break;case"before":o.value="";break;default:break}var u=window[o.name+"_bTime"]?BX.message("FORMAT_DATETIME"):BX.message("FORMAT_DATE");if(l)o.value=BX.formatDate(l,u);if(d)r.value=BX.formatDate(d,u)}var B="";switch(s.type.toLowerCase()){case"select-one":case"text":case"textarea":case"hidden":B=s.value;break;case"radio":case"checkbox":if(s.checked)B=s.value;break;case"select-multiple":var X;var b=s.options.length;for(X=0;X<b;X++)if(s.options[X].selected)e+="&"+s.name+"="+encodeURIComponent(s.options[X].value);break;default:break}if(B!="")e+="&"+s.name+"="+encodeURIComponent(B)}if(this.oOptions[this.curID]["SORT_FIELD"]&&typeof this.oOptions[this.curID]["SORT_FIELD"]=="object"){for(var _ in this.oOptions[this.curID]["SORT_FIELD"]){e+="&by="+encodeURIComponent(_)+"&order="+this.oOptions[this.curID]["SORT_FIELD"][_];break}}return e};this.CheckActive=function(){var t;var e=this.form.elements.length;for(t=0;t<e;t++){var i=form.elements[t];if(i.disabled)continue;var s=this.GetRowByElement(i);if(s&&s.style&&s.style.display=="none")continue;switch(i.type.toLowerCase()){case"select-one":if(i.options[0].value.length!=0&&(i.options[0].value.toUpperCase()!="NOT_REF"||i.value.toUpperCase()=="NOT_REF"))break;case"text":case"textarea":if(i.value.length>0)return true;break;case"checkbox":if(i.checked)return true;break;case"select-multiple":var a;var n=i.options.length;for(a=0;a<n;a++)if(i.options[a].selected&&i.options[a].value!="")return true;break;default:break}}return false};this.DisplayNonEmptyRows=function(){if(!this.form)return;var t;var e=this.form.elements.length;for(t=0;t<e;t++){var i=this.form.elements[t];if(i.disabled)continue;var s=false;switch(i.type.toLowerCase()){case"select-one":if(i.value.length>0&&(i.options[0].value.length==0||i.options[0].value!=i.value))s=true;break;case"text":case"textarea":if(i.value.length>0)s=true;break;case"checkbox":if(i.checked)s=true;break;case"select-multiple":var a;var n=i.options.length;for(a=0;a<n;a++)if(i.options[a].selected&&i.options[a].value!=""){s=true;break}break;default:break}if(s){var o=jsUtils.FindParentObject(i,"tr");if(o.id)this.ToggleFilterRow(o.id,true,false)}}};this.CountVisibleRows=function(){var t=0;for(var e=this.aRows.length-1;e>=0;e--)if(this.oVisRows[this.aRows[e]])t++;return t};this.SetBottomStyle=function(){var t=BX(this.filter_id+"_bottom_separator");var e=BX(this.filter_id+"_content");if(this.CountVisibleRows()>1){e.className="adm-filter-content";t.style.display="block"}else{e.className="adm-filter-content adm-filter-content-first";t.style.display="none"}};this.ToggleButtonShow=function(t){var e=BX(t);if(!e)return;e.cells[2].children[0].style.display="block"};this.ToggleButtonHide=function(t){var e=BX(t);if(!e)return;e.cells[2].children[0].style.display="none"};this.ToggleButtonsShowAll=function(){for(var t in this.aRows)this.ToggleButtonShow(this.filter_id+"_row_"+this.aRows[t])};this.ToggleButtonsHideAll=function(){for(var t in this.aRows)this.ToggleButtonHide(this.filter_id+"_row_"+this.aRows[t])};this.ToggleFilterRow=function(t,e,i,s){var a=BX(t),n=BX(t+"_delim"),o=0;if(!a||!n)return o;var r=t.substr((this.filter_id+"_row_").length);if(e!=true&&e!=false)e=a.style.display=="none";if(e==true){try{a.style.display="table-row";n.style.display="table-row"}catch(t){a.style.display="block";n.style.display="block"}this.oVisRows[r]=true;o=a.offsetHeight+n.offsetHeight}else{if(s||this.CountVisibleRows()>1){o=-(a.offsetHeight+n.offsetHeight);a.style.display="none";n.style.display="none";this.oVisRows[r]=false}}this.SetBottomStyle();var l=this.CountVisibleRows();if(l==1)this.ToggleButtonsHideAll();if(l==2)this.ToggleButtonsShowAll();if(i!=false)this.SaveRowsOption();return o};this.DeleteFilterRow=function(t){this.StartAnimation();this.ToggleFilterRow(t);this.EndAnimation()};this.StartAnimation=function(){if(this.state.folded)return;if(this.easing)this.easing.stop();this.startContentHeight=this.tableWrap.offsetHeight;this.tableWrap.style.height=this.startContentHeight+"px";this.tableWrap.style.overflowY="hidden"};this.EndAnimation=function(){if(this.state.folded)return;var t=this.table.offsetHeight;if(t==0){this.tableWrap.style.height="auto";this.tableWrap.style.overflowY="visible";return}this.easing=new BX.easing({duration:500,start:{height:this.startContentHeight,opacity:0},finish:{height:t,opacity:100},transition:BX.easing.makeEaseOut(BX.easing.transitions.quart),step:BX.proxy((function(t){this.tableWrap.style.height=t.height+"px";BX.onCustomEvent(this,"onAdminFilterToggleRow")}),this),complete:BX.proxy((function(){this.tableWrap.style.height="auto";this.tableWrap.style.overflowY="visible";this.easing=null;BX.onCustomEvent(this,"onAdminFilterToggleRow")}),this)});this.easing.animate()};this.SaveFilterParams=function(){var t="filter_id:"+this.filter_id+",";for(var e in this.params)t+=e+":"+this.params[e]+",";t=t.substr(0,t.length-1);document.cookie=BX.message("COOKIE_PREFIX")+"_ADM_FLT_PARAMS="+t};this.SaveRowsOption=function(){if(this.curID!="0"){this.Save(false);return true}var t="";for(var e in this.oVisRows)if(this.oVisRows[e]==true)t+=(t!=""?",":"")+e;jsUserOptions.SaveOption("filter",this.filter_id,"rows",t)};this.SaveOpenTab=function(t){var e={id:t,filter_id:this.filter_id,action:"open_tab_save",sessid:phpVars.bitrix_sessid,lang:BX.message("LANGUAGE_ID")};BX.ajax.post("/bitrix/admin/filter_act.php",e)};this.SaveFilteredId=function(t){var e={id:t,filter_id:this.filter_id,action:"filtered_tab_save",sessid:phpVars.bitrix_sessid,lang:BX.message("LANGUAGE_ID")};BX.ajax.post("/bitrix/admin/filter_act.php",e)};this.ToggleAllFilterRows=function(t){var e=document.getElementById(this.filter_id);if(!e)return;this.StartAnimation();var i=e.rows.length;for(var s=i-1;s>=0;s--){var a=e.rows[s];if(a.id&&a.cells[0].className!="delimiter")this.ToggleFilterRow(a.id,t,false)}if(t)this.ToggleButtonsShowAll();else this.ToggleButtonsHideAll();this.SaveRowsOption();this.EndAnimation()};this.SaveMenuShow=function(e){var i=[];if(this.curID!="0")i.push({TEXT:BX.message("JSADM_FLT_SAVE"),ONCLICK:t+".Save();"});i.push({TEXT:BX.message("JSADM_FLT_SAVE_AS"),ONCLICK:"setTimeout(function(){"+t+".SaveAs();},10);"});if(this.curID!="0")i.push({TEXT:BX.message("JSADM_FLT_DELETE"),ONCLICK:t+".Delete();"});if(!e.OPENER)BX.adminShowMenu(e,i);else e.OPENER.SetMenu(i)};this.SettMenuItemClick=function(t,e){var i=BX.WindowManager.Get();if(i&&BX.type.isFunction(i.toggleArrow))i.toggleArrow(false);this.StartAnimation();var s=this.ToggleFilterRow(t);this.EndAnimation()};this.SettMenuShow=function(e){var i=BX(this.filter_id);if(!i)return;var s=[];var a=this.missingRows;var n=this.aRows.length-1;for(var o=i.rows.length-1;o>=0;o--){var r=i.rows[o];if(!r.id||r.cells[0].className=="delimiter")continue;var l="";if(n-a>=0)l=this.popupItems[this.aRows[n]];else l=(r.cells[0].textContent||r.cells[0].innerText).replace(/:$/,"");s.unshift({TEXT:l,ONCLICK:t+".SettMenuItemClick('"+r.id+"',this);",CLOSE_ON_CLICK:false,ADJUST_ON_CLICK:false,CHECKED:r.style.display!="none"});n--}s.push({SEPARATOR:true});s.push({TEXT:BX.message("JSADM_FLT_SHOW_ALL"),ONCLICK:t+".ToggleAllFilterRows(true);"});s.push({TEXT:BX.message("JSADM_FLT_HIDE_ALL"),ONCLICK:t+".ToggleAllFilterRows(false);"});if(!e.OPENER)BX.adminShowMenu(e,s);else{e.OPENER.SetMenu(s);var d=e.OPENER.GetMenu();if(d)d.toggleArrow(true)}}};BX.admFltTab=function(t,e){this.id=t;this.filter=e};BX.admFltTab.prototype={GetObjId:function(){return"adm-filter-tab-"+this.filter.filter_id+"-"+this.id},GetObj:function(){var t=this.GetObjId();return BX(t)},SetActive:function(){BX.addClass(this.GetObj(),"adm-filter-tab-active")},UnSetActive:function(){BX.removeClass(this.GetObj(),"adm-filter-tab-active")},SetFiltered:function(t){if(this.filter.params.filteredId!==false&&this.filter.oOptions[this.filter.params.filteredId]!==undefined&&!t)this.filter.oOptions[this.filter.params.filteredId]["tab"].UnSetFiltered();BX.addClass(this.GetObj(),"adm-current-filter-tab");if(!t){this.filter.params.filteredId=this.id;this.filter.SaveFilterParams()}this.filter.params.filteredId=this.id;this.filter.SetFilteredBG(this.id)},UnSetFiltered:function(){this.filter.params.filteredId=false;BX.removeClass(this.GetObj(),"adm-current-filter-tab");this.filter.SetFilteredBG(false);this.filter.SaveFilterParams()},_RegisterDD:function(t,e,i){if(!BX.adminMenu||!BX.adminMenu.registerItem){return}if(!e){return}var s=BX.util.remove_url_param(e,["adm_filter_applied","adm_filter_preset"]);s+="&adm_filter_applied"+"="+BX.util.urlencode(this.id);BX.adminMenu.registerItem(t,{URL:s,TITLE:true})},AddHtml:function(t,e){var i=this;var s=BX("filter-tabs-"+this.filter.filter_id);var a=document.createElement("span");a.className="adm-filter-tab";a.id=this.GetObjId();a.onclick=function(){i.filter.SetActiveTab(this);i.filter.ApplyFilter(i.id)};a.innerHTML=BX.util.htmlspecialchars(e);s.insertBefore(a,BX("adm-filter-add-tab-"+this.filter.filter_id));this._RegisterDD(a.id,t,e);this.filter.SetActiveTab(a);this.filter.ApplyFilter(this.id)},DeleteHtml:function(){var t=this.GetObj();if(t)t.parentNode.removeChild(t)},ShowWheel:function(){var t=250;setTimeout(BX.proxy((function(){if(this.GetObj())BX.addClass(this.GetObj(),"adm-filter-tab-loading")}),this),t)}};BX.admFltWrap={Inner:function(t,e,i,s){var a=document.createElement(i);if(s)a.className=s;if(e)t.className=e;var n=BX.findChildren(t);for(var o in n)a.appendChild(n[o]);t.appendChild(a);return a},Element:function(t,e,i,s){var a=document.createElement(i);if(s)a.className=s;if(e)t.className=e;t.parentNode.insertBefore(a,t);a.appendChild(t);return a},Input:function(t){var e=false;switch(t.type){case"select-one":if(t.size&&t.size>1)e=BX.admFltWrap.Element(t,"adm-select-multiple","span","adm-select-wrap-multiple");else e=BX.admFltWrap.Element(t,"adm-select","span","adm-select-wrap");break;case"select-multiple":e=BX.admFltWrap.Element(t,"adm-select-multiple","span","adm-select-wrap-multiple");break;case"text":e=BX.admFltWrap.Element(t,"adm-input","div","adm-input-wrap");break;case"checkbox":var i=BX.findChild(t.parentNode,{tagName:"label",htmlFor:t.id});if(!i){var s=BX.admFltWrap.Element(t,"","label","");if(i&&i.childNodes[0]){s.appendChild(i.childNodes[0]);i.parentNode.removeChild(i)}}BX.adminFormTools.modifyCheckbox(t);break;case"submit":case"button":case"reset":case"hidden":default:break}return e},Cell:function(t){var e=t.cloneNode(true);var i;e.innerHTML="";while(t.childNodes.length){switch(t.childNodes[0].nodeName.toLowerCase()){case"small":BX.admFltWrap.Element(t.childNodes[0],"","span","adm-filter-text-wrap");break;case"#text":t.childNodes[0].nodeValue=jsUtils.trim(t.childNodes[0].nodeValue);if(t.childNodes[0].nodeValue==""){t.removeChild(t.childNodes[0]);continue}BX.admFltWrap.Element(t.childNodes[0],"","span","adm-filter-text-wrap");break;case"label":if(t.childNodes[0].className=="adm-designed-checkbox-label")break;var s=BX.findChild(t.childNodes[0],{tag:"input"});if(s)i=BX.admFltWrap.Input(s);break;case"input":var a=false;var n=BX.findNextSibling(t.childNodes[0],{tagName:"INPUT"});if(t.childNodes[0].type=="text"&&(!n||n.type!="text"))a=BX.findChild(t.childNodes[0].parentNode,{className:"adm-input-help-icon"});i=BX.admFltWrap.Input(t.childNodes[0]);if(a){BX.addClass(i,"adm-input-help-icon-wrap");i.appendChild(a)}break;case"select":BX.admFltWrap.Input(t.childNodes[0]);break;case"iframe":t.childNodes[0].style.display="none";break;case"span":if(t.childNodes[0].style.display!="none")t.childNodes[0].style.display="inline-block";break;default:break}e.appendChild(t.childNodes[0])}return e},Row:function(t){t.cells[0].className="adm-filter-item-left";t.cells[1].className="adm-filter-item-center";t.cells[2].className="adm-filter-item-right";t.cells[0].innerHTML=t.cells[0].innerHTML.replace(/<\/?[^>]+>/gi,"");var e=!!BX.findChild(t.cells[1],{className:"adm-input adm-input-calendar"},true);if(e){var i=BX.admFltWrap.Inner(t.cells[1],"","DIV","adm-calendar-block adm-filter-alignment");BX.admFltWrap.Inner(i,"","DIV","adm-filter-box-sizing");return null}if(t.cells[1].children[0]&&!BX.hasClass(t.cells[1].children[0],"adm-filter-alignment")){var s=BX.create("div",{props:{className:"adm-filter-box-sizing"}});var a=BX.create("div",{props:{className:"adm-filter-alignment"}});t.cells[1].innerHTML=BX.admFltWrap.Cell(t.cells[1]).innerHTML;while(t.cells[1].children.length>0)s.appendChild(t.cells[1].children[0]);a.appendChild(s);t.cells[1].appendChild(a)}return t}};BX.adminChain={_addon:null,addItems:function(t){BX.ready((function(){BX.adminChain._addItems(t)}))},_addItems:function(t){var e=BX("main_navchain");if(!e)return;if(!!this._addon){this._addon.parentNode.removeChild(this._addon);this._addon=null}var i=BX(t);if(!i)return;this._addon=e.appendChild(BX.create("span",{html:'<span class="adm-navchain-delimiter"></span>'+i.innerHTML}))}};BX.InitializeAdmin=function(){BX.browser.addGlobalFeatures(["boxShadow","borderRadius","flexWrap","boxDirection","transition","transform"]);BX.adminPanel=new BX.adminPanel;BX.adminMenu=new BX.adminMenu;if(!!(history.pushState&&BX.type.isFunction(history.pushState))){BX.adminHistory=new BX.adminHistory}BX.ready((function(){var t=BX("adm-workarea");if(t)t.style.opacity=1}))};BX.adminPanel.modifyFormElements=BX.adminFormTools.modifyFormElements;BX.adminPanel.modifyFormElement=BX.adminFormTools.modifyFormElement})();
//# sourceMappingURL=core_admin_interface.map.js